mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 20:25:48 +00:00
Remove "type" from PathSet JSON format
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ripple-binary-codec",
|
"name": "ripple-binary-codec",
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"description": "ripple binary codec",
|
"description": "ripple binary codec",
|
||||||
"files": [
|
"files": [
|
||||||
"distrib/npm/*",
|
"distrib/npm/*",
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const Hop = makeClass({
|
|||||||
},
|
},
|
||||||
toJSON() {
|
toJSON() {
|
||||||
const type = this.type();
|
const type = this.type();
|
||||||
const ret = {type};
|
const ret = {};
|
||||||
(type & TYPE_ACCOUNT) && (ret.account = this.account.toJSON());
|
(type & TYPE_ACCOUNT) && (ret.account = this.account.toJSON());
|
||||||
(type & TYPE_ISSUER) && (ret.issuer = this.issuer.toJSON());
|
(type & TYPE_ISSUER) && (ret.issuer = this.issuer.toJSON());
|
||||||
(type & TYPE_CURRENCY) && (ret.currency = this.currency.toJSON());
|
(type & TYPE_CURRENCY) && (ret.currency = this.currency.toJSON());
|
||||||
|
|||||||
@@ -280,46 +280,35 @@ function pathSetBinaryTests() {
|
|||||||
const expectedJSON =
|
const expectedJSON =
|
||||||
[[{account: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K',
|
[[{account: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K',
|
||||||
currency: 'BTC',
|
currency: 'BTC',
|
||||||
issuer: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K',
|
issuer: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K'},
|
||||||
type: 49},
|
|
||||||
{account: 'rM1oqKtfh1zgjdAgbFmaRm3btfGBX25xVo',
|
{account: 'rM1oqKtfh1zgjdAgbFmaRm3btfGBX25xVo',
|
||||||
currency: 'BTC',
|
currency: 'BTC',
|
||||||
issuer: 'rM1oqKtfh1zgjdAgbFmaRm3btfGBX25xVo',
|
issuer: 'rM1oqKtfh1zgjdAgbFmaRm3btfGBX25xVo'},
|
||||||
type: 49},
|
|
||||||
{account: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',
|
{account: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',
|
||||||
currency: 'BTC',
|
currency: 'BTC',
|
||||||
issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',
|
issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B'},
|
||||||
type: 49},
|
|
||||||
{currency: 'USD',
|
{currency: 'USD',
|
||||||
issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',
|
issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B'}],
|
||||||
type: 48}],
|
|
||||||
[{account: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K',
|
[{account: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K',
|
||||||
currency: 'BTC',
|
currency: 'BTC',
|
||||||
issuer: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K',
|
issuer: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K'},
|
||||||
type: 49},
|
|
||||||
{account: 'rM1oqKtfh1zgjdAgbFmaRm3btfGBX25xVo',
|
{account: 'rM1oqKtfh1zgjdAgbFmaRm3btfGBX25xVo',
|
||||||
currency: 'BTC',
|
currency: 'BTC',
|
||||||
issuer: 'rM1oqKtfh1zgjdAgbFmaRm3btfGBX25xVo',
|
issuer: 'rM1oqKtfh1zgjdAgbFmaRm3btfGBX25xVo'},
|
||||||
type: 49},
|
|
||||||
{account: 'rpvfJ4mR6QQAeogpXEKnuyGBx8mYCSnYZi',
|
{account: 'rpvfJ4mR6QQAeogpXEKnuyGBx8mYCSnYZi',
|
||||||
currency: 'BTC',
|
currency: 'BTC',
|
||||||
issuer: 'rpvfJ4mR6QQAeogpXEKnuyGBx8mYCSnYZi',
|
issuer: 'rpvfJ4mR6QQAeogpXEKnuyGBx8mYCSnYZi'},
|
||||||
type: 49},
|
|
||||||
{currency: 'USD',
|
{currency: 'USD',
|
||||||
issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',
|
issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B'}],
|
||||||
type: 48}],
|
|
||||||
[{account: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K',
|
[{account: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K',
|
||||||
currency: 'BTC',
|
currency: 'BTC',
|
||||||
issuer: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K',
|
issuer: 'r9hEDb4xBGRfBCcX3E4FirDWQBAYtpxC8K'},
|
||||||
type: 49},
|
|
||||||
{account: 'r3AWbdp2jQLXLywJypdoNwVSvr81xs3uhn',
|
{account: 'r3AWbdp2jQLXLywJypdoNwVSvr81xs3uhn',
|
||||||
currency: 'BTC',
|
currency: 'BTC',
|
||||||
issuer: 'r3AWbdp2jQLXLywJypdoNwVSvr81xs3uhn',
|
issuer: 'r3AWbdp2jQLXLywJypdoNwVSvr81xs3uhn'},
|
||||||
type: 49},
|
{currency: '0000000000000000000000005852500000000000'},
|
||||||
{currency: '0000000000000000000000005852500000000000', type: 16},
|
|
||||||
{currency: 'USD',
|
{currency: 'USD',
|
||||||
issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B',
|
issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B'}]];
|
||||||
type: 48}]];
|
|
||||||
|
|
||||||
it('works with long paths', () => {
|
it('works with long paths', () => {
|
||||||
const parser = makeParser(bytes);
|
const parser = makeParser(bytes);
|
||||||
|
|||||||
@@ -1309,7 +1309,6 @@
|
|||||||
"Flags": 0,
|
"Flags": 0,
|
||||||
"Sequence": 6,
|
"Sequence": 6,
|
||||||
"Paths": [[{
|
"Paths": [[{
|
||||||
"type": 1,
|
|
||||||
"account": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA"
|
"account": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA"
|
||||||
}]],
|
}]],
|
||||||
"DestinationTag": 736049272
|
"DestinationTag": 736049272
|
||||||
@@ -1414,7 +1413,6 @@
|
|||||||
"00"
|
"00"
|
||||||
],
|
],
|
||||||
"json": [[{
|
"json": [[{
|
||||||
"type": 1,
|
|
||||||
"account": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA"
|
"account": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA"
|
||||||
}]],
|
}]],
|
||||||
"field_header": "0112"
|
"field_header": "0112"
|
||||||
@@ -1850,7 +1848,6 @@
|
|||||||
"Sequence": 10,
|
"Sequence": 10,
|
||||||
"Paths": [[{
|
"Paths": [[{
|
||||||
"currency": "BTC",
|
"currency": "BTC",
|
||||||
"type": 48,
|
|
||||||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
|
||||||
}]],
|
}]],
|
||||||
"InvoiceID": "342B8D16BEE494D169034AFF0908FDE35874A38E548D4CEC8DFC5C49E9A33B76",
|
"InvoiceID": "342B8D16BEE494D169034AFF0908FDE35874A38E548D4CEC8DFC5C49E9A33B76",
|
||||||
@@ -1958,7 +1955,6 @@
|
|||||||
],
|
],
|
||||||
"json": [[{
|
"json": [[{
|
||||||
"currency": "BTC",
|
"currency": "BTC",
|
||||||
"type": 48,
|
|
||||||
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
|
"issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
|
||||||
}]],
|
}]],
|
||||||
"field_header": "0112"
|
"field_header": "0112"
|
||||||
|
|||||||
Reference in New Issue
Block a user