Tickets support (#110)

* feat(tickets): add TicketCount definition

* feat(tickets): add TicketSequence definition

* fix(tests): unit tests
This commit is contained in:
elmurci
2020-11-17 17:33:20 +01:00
parent b43e79a9af
commit 479ade8a76
5 changed files with 59 additions and 0 deletions

View File

@@ -51,6 +51,13 @@ const PaymentChannel = {
},
};
const Ticket = {
create: {
tx: require("./fixtures/ticket-create-tx.json"),
binary: require("./fixtures/ticket-create-binary.json"),
},
};
let json_undefined = {
TakerPays: "223174650",
Account: "rPk2dXr27rMw9G5Ej9ad2Tt7RJzGy8ycBp",
@@ -236,6 +243,12 @@ function omitUndefinedTest() {
});
}
function ticketTest() {
test("can serialize TicketCreate", () => {
expect(encode(Ticket.create.tx)).toEqual(Ticket.create.binary);
});
}
describe("Binary Serialization", function () {
describe("nestedObjectTests", () => nestedObjectTests());
describe("BytesList", () => bytesListTest());
@@ -246,4 +259,5 @@ describe("Binary Serialization", function () {
describe("PaymentChannel", () => PaymentChannelTest());
describe("NegativeUNLTest", () => NegativeUNLTest());
describe("OmitUndefined", () => omitUndefinedTest());
describe("TicketTest", () => ticketTest());
});