Update docs for isInBlock (rather late than never) (#1923)

* Update docs for isInBlock (rather late than never)

* Only warn on isInBlock filtering
This commit is contained in:
Jaco Greeff
2020-02-22 14:53:46 +01:00
committed by GitHub
parent 4ec87dc51c
commit 790deca695
9 changed files with 45 additions and 26 deletions
+7 -2
View File
@@ -25,9 +25,14 @@ async function main () {
.signAndSend(alice)
// Subscribe to the status updates of the transfer
.subscribe(({ status }) => {
if (status.isFinalized) {
console.log(`Successful transfer of 12345 from Alice to Bob with hash ${status.asFinalized.toHex()}`);
if (status.isInBlock) {
console.log(`Successful transfer of 12345 from Alice to Bob at block ${status.asInBlock.toHex()}`);
} else if (status.isFinalized) {
console.log('Finalized block hash', status.asFinalized.toHex());
subscription.unsubscribe();
process.exit(0);
} else {
console.log(`Status of transfer: ${status.type}`);
}