Skip to content

Commit

Permalink
Merge PR #1157 from 'emjshrx/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Jul 20, 2023
2 parents cd64844 + 6682fa5 commit 014a104
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ node ./migrate/walletdb7to8.js /path/to/bcoin/wallet
#### RPC

- Added `getnodeaddresses` which returns entries from the hostlist.
- Updated `estimatesmartfee` to return attribute `feerate` (previously `fee`).

### Indexer changes

Expand Down
2 changes: 1 addition & 1 deletion lib/node/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,7 @@ class RPC extends RPCBase {
fee = Amount.btc(fee, true);

return {
fee: fee,
feerate: fee,
blocks: blocks
};
}
Expand Down
19 changes: 13 additions & 6 deletions test/node-rpc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,16 +642,23 @@ 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 014a104

Please sign in to comment.