\r
it('should verify a block using the public key', async () => {\r
const accounts = await wallet.accounts()\r
+ const account = accounts[0]\r
const sendBlock = new SendBlock(\r
- accounts[0].address,\r
+ account.address,\r
'5618869000000000000000000000000',\r
'nano_1q3hqecaw15cjt7thbtxu3pbzr1eihtzzpzxguoc37bj1wc5ffoh7w74gi6p',\r
'2000000000000000000000000000000',\r
'nano_1stofnrxuz3cai7ze75o174bpm7scwj9jn3nxsn8ntzg784jf1gzn1jjdkou',\r
'92BA74A7D6DC7557F3EDA95ADC6341D51AC777A0A6FF0688A5C492AB2B2CB40D',\r
)\r
- await sendBlock.sign(accounts[0].privateKey)\r
- const valid = await sendBlock.verify(accounts[0].publicKey)\r
+ await sendBlock.sign(account.privateKey)\r
+ const valid = await sendBlock.verify(account.publicKey)\r
assert.equal(valid, true)\r
})\r
\r
it('should reject a block using the wrong public key', async () => {\r
const accounts = await wallet.accounts()\r
+ const account = accounts[0]\r
const sendBlock = new SendBlock(\r
- accounts[0].address,\r
+ account.address,\r
'5618869000000000000000000000000',\r
'nano_1q3hqecaw15cjt7thbtxu3pbzr1eihtzzpzxguoc37bj1wc5ffoh7w74gi6p',\r
'2000000000000000000000000000000',\r
'nano_1stofnrxuz3cai7ze75o174bpm7scwj9jn3nxsn8ntzg784jf1gzn1jjdkou',\r
'92BA74A7D6DC7557F3EDA95ADC6341D51AC777A0A6FF0688A5C492AB2B2CB40D',\r
)\r
- sendBlock.sign(accounts[0].privateKey)\r
+ sendBlock.sign(account.privateKey)\r
\r
sendBlock.account = new Account('nano_1q3hqecaw15cjt7thbtxu3pbzr1eihtzzpzxguoc37bj1wc5ffoh7w74gi6p')\r
- const valid = await sendBlock.verify(accounts[0].publicKey)\r
+ const valid = await sendBlock.verify(account.publicKey)\r
assert.equal(valid, false)\r
})\r
\r