JS: Restrict UInt160 parse_json to wire format.

This commit is contained in:
Arthur Britto
2013-01-03 00:54:20 -08:00
committed by Stefan Thomas
parent a574207b40
commit e5c6acde7d
2 changed files with 30 additions and 4 deletions

View File

@@ -17,13 +17,13 @@ var config = require('./config.js');
buster.testCase("Amount", {
"UInt160" : {
"Parse 0" : function () {
buster.assert.equals(nbi(), UInt160.from_json("0")._value);
buster.assert.equals(nbi(), UInt160.from_generic("0")._value);
},
"Parse 0 export" : function () {
buster.assert.equals(amount.consts.address_xns, UInt160.from_json("0").to_json());
buster.assert.equals(amount.consts.address_xns, UInt160.from_generic("0").to_json());
},
"Parse 1" : function () {
buster.assert.equals(new BigInteger([1]), UInt160.from_json("1")._value);
buster.assert.equals(new BigInteger([1]), UInt160.from_generic("1")._value);
},
"Parse rrrrrrrrrrrrrrrrrrrrrhoLvTp export" : function () {
buster.assert.equals(amount.consts.address_xns, UInt160.from_json("rrrrrrrrrrrrrrrrrrrrrhoLvTp").to_json());