-
Notifications
You must be signed in to change notification settings - Fork 6
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
base: develop
Are you sure you want to change the base?
Conversation
@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 |
That's a good idea @HashMapsData2Value, I'll add it to the compose configuration |
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); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
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).
- Sends Sign Transactions RequestMessage with encoded transactions to be signed
- Wallet handles RequestMessage in WalletProvider
- Sends Sign Transactions ResponseMessage with signatures indexed by the original transaction request
- Receiver attaches the signatures and posts them to the algod
ℹ Overview
Blocked By
📝 Related Issues
✅ Acceptance:
npm test:cov
passes