Skip to content

Commit 05bfb34

Browse files
authored
Beta (#97)
* TX Demo Code
1 parent ca51f4b commit 05bfb34

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

viat/blocks/block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export class Block {
121121
this.setMeta('nonce', this.cipherSuite.createBlockNonce(this.nonceSize));
122122
}
123123
async createSignature(wallet) {
124-
const binary = await this.exportDataBinary();
124+
const binary = this.block.hash;
125125
const signature = await wallet.signPartial(binary);
126126
return signature;
127127
}

viat/wallet/wallet.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ export class Wallet extends CryptoID {
2323
}
2424
});
2525
await txBlock.finalize();
26+
await txBlock.sign(this);
2627
await txBlock.createReceipt();
2728
await txBlock.receipt.finalize();
29+
await txBlock.receipt.sign(this);
2830
console.log('Transaction Block:', txBlock.block);
2931
return txBlock;
3032
}

0 commit comments

Comments
 (0)