mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
Tickets support (#110)
* feat(tickets): add TicketCount definition * feat(tickets): add TicketSequence definition * fix(tests): unit tests
This commit is contained in:
@@ -33,6 +33,23 @@ describe("encoding and decoding tx_json", function () {
|
||||
const decoded = decode(encoded);
|
||||
expect(my_tx).toEqual(decoded);
|
||||
});
|
||||
test("can encode tx_json with TicketCount", function () {
|
||||
const my_tx = Object.assign({}, tx_json, {
|
||||
TicketCount: 2,
|
||||
});
|
||||
const encoded = encode(my_tx);
|
||||
const decoded = decode(encoded);
|
||||
expect(my_tx).toEqual(decoded);
|
||||
});
|
||||
test("can encode tx_json with TicketSequence", function () {
|
||||
const my_tx = Object.assign({}, tx_json, {
|
||||
Sequence: 0,
|
||||
TicketSequence: 2,
|
||||
});
|
||||
const encoded = encode(my_tx);
|
||||
const decoded = decode(encoded);
|
||||
expect(my_tx).toEqual(decoded);
|
||||
});
|
||||
test("throws when Amount is invalid", function () {
|
||||
const my_tx = Object.assign({}, tx_json, {
|
||||
Amount: "1000.001",
|
||||
|
||||
Reference in New Issue
Block a user