Skip to content

Commit

Permalink
Merge PR #596 from 'nodech/fix/minor-cleanup'
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed May 17, 2021
2 parents e759938 + b4b28a0 commit bedcb3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions test/coin-test.js
Expand Up @@ -42,10 +42,10 @@ describe('Coin', function() {
const bw = new BufferWriter(fromJSON.getSize());
fromJSON.write(bw);

const fromRaw = Coin.fromRaw(bw.render()).getJSON(network);
const coin = Coin.decode(bw.render()).getJSON(network);

for (const [key, want] of Object.entries(json)) {
const got = fromRaw[key];
const got = coin[key];
assert.deepEqual(want, got);
}
}
Expand All @@ -69,7 +69,7 @@ describe('Coin', function() {
it('should instantiate from raw', () => {
const json = require('./data/coin1.json');
const want = Coin.fromJSON(json);
const got = Coin.fromRaw(coin1);
const got = Coin.decode(coin1);

assert.deepEqual(want.version, got.version);
assert.deepEqual(want.height, got.height);
Expand Down
6 changes: 3 additions & 3 deletions test/coins-test.js
Expand Up @@ -16,10 +16,10 @@ const common = require('./util/common');
const tx1 = common.readTX('tx1');

function reserialize(coin) {
const raw = coin.toRaw();
const entry = CoinEntry.fromRaw(raw);
const raw = coin.encode();
const entry = CoinEntry.decode(raw);
entry.raw = null;
return CoinEntry.fromRaw(entry.toRaw());
return CoinEntry.decode(entry.encode());
}

function deepCoinsEqual(a, b) {
Expand Down
2 changes: 1 addition & 1 deletion test/net-test.js
Expand Up @@ -401,7 +401,7 @@ describe('Net', function() {
let pkt = new packets.SendHeadersPacket();
check(pkt);

pkt = packets.SendHeadersPacket.fromRaw(pkt.toRaw());
pkt = packets.SendHeadersPacket.decode(pkt.encode());
check(pkt);
});

Expand Down

0 comments on commit bedcb3b

Please sign in to comment.