suite('Block performance', { skip: true }, async () => {
const COUNT = 0x200
- await test(`libnemo: Time to calculate proof-of-work for a send block ${COUNT} times`, { skip: true }, async () => {
- const { account, balance, previous, representative } = NANO_TEST_VECTORS.SEND_BLOCK
+ await test(`sign a send block ${COUNT} times`, async () => {
+ const { account, balance, key, previous, representative } = NANO_TEST_VECTORS.SEND_BLOCK
const times = []
- const block = new Block(account, balance, representative, previous)
+ const block = new Block(account, balance, previous, representative)
.send(NANO_TEST_VECTORS.SEND_BLOCK.link, 0)
for (let i = 0; i < COUNT; i++) {
const start = performance.now()
- await block.pow()
+ await block.sign(key)
const end = performance.now()
times.push(end - start)
- console.log(`${block.work} (${end - start} ms)`)
}
console.log(stats(times))
})