Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove demo dApp and flatten workspace #40

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

PhearZero
Copy link
Member

@PhearZero PhearZero commented Sep 5, 2024

ℹ Overview

  • flattens service repository by removing workspaces
  • migrates demo dApp to be a part of the documentation landing page
  • optimizes docker image

Blocked By

📝 Related Issues

✅ Acceptance:

  • Conventional Commits
  • npm test:cov passes

@PhearZero PhearZero self-assigned this Sep 5, 2024
@PhearZero PhearZero marked this pull request as ready for review September 9, 2024 16:05
@HashMapsData2Value
Copy link
Contributor

Screenshot 2024-09-09 at 18 19 00

Are these errors expected as part of the tests?

@PhearZero
Copy link
Member Author

PhearZero commented Sep 9, 2024

Are these errors expected as part of the tests?

@HashMapsData2Value Correct, you can see the status checks have passed and the exit code should be 0. The error conditions are mainly to get coverage up to 100%. It also run though a few different cases instead of just testing one user

@HashMapsData2Value
Copy link
Contributor

HashMapsData2Value commented Sep 9, 2024

I followed the README in the top of the repo and spun up docker-compose.

Screenshot 2024-09-09 at 21 02 38

Only suggestion I'd make is that it would be nice if the doc could also be included into the docker-compose, so that setting up the ngrok secrets and domain and then running docker-compose up -d would give you the docs immediately.

But I also understand not doing that, and just having people navigate to the docs, doing npm run dev and using the liquid-auth.onrender.com backend by default.

LGTM.

@PhearZero
Copy link
Member Author

That's a good idea @HashMapsData2Value, I'll add it to the compose configuration

Comment on lines +138 to +156
try{
// Try to parse JSON messages, useful for testing
console.log(JSON.parse(event.data))
} catch (e){
let data = fromResult(event.data) as ResponseMessage;
setStatus(RECEIVED_SIGNATURE)
const stxns = _txn.attachSignature(_auth ? _auth : _wallet, fromBase64Url(data.result.stxns[0]))
if(!stxns) {
setStatus(ERROR);
} else {
algod.sendRawTransaction(stxns).do().then(({txId})=>{
setStatus(SUBMITTED_TRANSACTION)
waitForConfirmation(algod, txId, 4).then(()=>{
setStatus(TRANSACTION_CONFIRMED)
setIsInflight(false)
});
}).catch(handleError);
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Member Author

@PhearZero PhearZero Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reattaches the signature from the wallet using the ResponseMessage (flavor of ARC-0027). There is no guarantee that someone will always send it the properly encoded objects. We test to see if it is a JSON object and then log it (liquid is always sending encoded byte strings).

  1. Sends Sign Transactions RequestMessage with encoded transactions to be signed
  2. Wallet handles RequestMessage in WalletProvider
  3. Sends Sign Transactions ResponseMessage with signatures indexed by the original transaction request
  4. Receiver attaches the signatures and posts them to the algod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants