serum-js/src/index.test.js

16 lines
1.9 KiB
JavaScript
Raw Normal View History

2020-08-06 10:17:24 -07:00
import { parseSlab } from './index';
describe('slab', () => {
it('parses', () => {
const slab = parseSlab(
Buffer.from(
'0900000000000000020000000000000008000000000000000400000000000000010000001e00000000000040952fe4da5c1f3c860200000004000000030000000d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d7b000000000000000200000002000000000000a0ca17726dae0f1e4301000000111111111111111111111111111111111111111111111111111111111111111141010000000000000200000001000000d20a3f4eeee073c3f60fe98e010000000d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d7b00000000000000020000000300000000000040952fe4da5c1f3c8602000000131313131313131313131313131313131313131313131313131313131313131340e2010000000000010000001f0000000500000000000000000000000000000005000000060000000d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d7b00000000000000020000000400000004000000000000000000000000000000171717171717171717171717171717171717171717171717171717171717171702000000000000000100000020000000000000a0ca17726dae0f1e430100000001000000020000000d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d7b000000000000000400000000000000040000000000000000000000000000001717171717171717171717171717171717171717171717171717171717171717020000000000000003000000070000000500000000000000000000000000000017171717171717171717171717171717171717171717171717171717171717170200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
'hex',
),
);
console.log(slab);
console.log(slab.nodes[1]);
console.log(slab.nodes[1].leafNode.owner.toBase58());
});
});