Add test for node public keys

This commit is contained in:
Nicholas Dudfield
2015-07-22 13:15:40 +07:00
parent 93236f4795
commit ad45b4d341
2 changed files with 8 additions and 2 deletions

View File

@@ -15,8 +15,10 @@ describe('ripple-address-codec', function() {
it('can translate between ' + hex + ' and ' + base58, function() {
var actual = api['encode' + type](toBytes(hex));
var buf = api['decode' + type](base58);
assert.equal(actual, base58);
});
it('can translate between ' + base58 + ' and ' + hex, function() {
var buf = api['decode' + type](base58);
assert.equal(toHex(buf), hex);
});
}
@@ -24,6 +26,9 @@ describe('ripple-address-codec', function() {
makeTest('AccountID', 'rJrRMgiRgrU6hDF4pgu5DXQdWyPbY35ErN',
'BA8E78626EE42C41B46D46C3048DF3A1C3C87072');
makeTest('NodePublic', 'n9MXXueo837zYH36DvMc13BwHcqtfAWNJY5czWVbp7uYTj7x17TH',
'0388E5BA87A000CB807240DF8C848EB0B5FFA5C8E5A521BC8E105C0F0A44217828');
makeTest('K256Seed', 'sn259rEFXrQrWyx3Q7XneWcwV6dfL',
'CF2DE378FBDD7E2EE87D486DFB5A7BFF');