Skip to content

Commit

Permalink
test: add test for estimatesmartfee
Browse files Browse the repository at this point in the history
  • Loading branch information
emjshrx committed Jul 15, 2023
1 parent c50db1b commit 350e6b0
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions test/node-rpc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,16 +542,22 @@ describe('RPC', function() {
});

describe('utilities', function() {
// 0-in, 2-out
const rawTX1 =
'0100000000024e61bc00000000001976a914fbdd46898a6d70a682cbd34420cc' +
'f0b6bb64493788acf67e4929010000001976a9141b002b6fc0f457bf8d092722' +
'510fce9f37f0423b88ac00000000';

it('should decoderawtransaction', async () => {
// 0-in, 2-out
const rawTX1 =
'0100000000024e61bc00000000001976a914fbdd46898a6d70a682cbd34420cc' +
'f0b6bb64493788acf67e4929010000001976a9141b002b6fc0f457bf8d092722' +
'510fce9f37f0423b88ac00000000';
const result = await nclient.execute('decoderawtransaction', [rawTX1]);
assert.strictEqual(result.vin.length, 0);
assert.strictEqual(result.vout.length, 2);
});
it('should estimate fee rate', async () => {
const result = await nclient.execute('estimatesmartfee', [6]);
assert.deepStrictEqual(result, {
blocks: 6,
feerate: -1
});
});
});
});

0 comments on commit 350e6b0

Please sign in to comment.