mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 12:45:50 +00:00
add support for nfts in binary codec (#1797)
This commit is contained in:
@@ -244,15 +244,46 @@ function ticketTest() {
|
||||
})
|
||||
}
|
||||
|
||||
function nfTokenTest() {
|
||||
const fixtures = require('./fixtures/nf-token.json')
|
||||
|
||||
for (const txName of Object.keys(fixtures)) {
|
||||
test(`can serialize transaction ${txName}`, () => {
|
||||
expect(encode(fixtures[txName].tx.json)).toEqual(
|
||||
fixtures[txName].tx.binary,
|
||||
)
|
||||
})
|
||||
|
||||
test(`can deserialize transaction ${txName}`, () => {
|
||||
expect(decode(fixtures[txName].tx.binary)).toEqual(
|
||||
fixtures[txName].tx.json,
|
||||
)
|
||||
})
|
||||
|
||||
test(`can serialize meta ${txName}`, () => {
|
||||
expect(encode(fixtures[txName].meta.json)).toEqual(
|
||||
fixtures[txName].meta.binary,
|
||||
)
|
||||
})
|
||||
|
||||
test(`can deserialize meta ${txName}`, () => {
|
||||
expect(decode(fixtures[txName].meta.binary)).toEqual(
|
||||
fixtures[txName].meta.json,
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
describe('Binary Serialization', function () {
|
||||
describe('nestedObjectTests', () => nestedObjectTests())
|
||||
describe('BytesList', () => bytesListTest())
|
||||
describe('DeliverMin', () => deliverMinTest())
|
||||
describe('DepositPreauth', () => DepositPreauthTest())
|
||||
describe('SignerListSet', () => SignerListSetTest())
|
||||
describe('Escrow', () => EscrowTest())
|
||||
describe('PaymentChannel', () => PaymentChannelTest())
|
||||
describe('NegativeUNLTest', () => NegativeUNLTest())
|
||||
describe('OmitUndefined', () => omitUndefinedTest())
|
||||
describe('TicketTest', () => ticketTest())
|
||||
describe('nestedObjectTests', nestedObjectTests)
|
||||
describe('BytesList', bytesListTest)
|
||||
describe('DeliverMin', deliverMinTest)
|
||||
describe('DepositPreauth', DepositPreauthTest)
|
||||
describe('SignerListSet', SignerListSetTest)
|
||||
describe('Escrow', EscrowTest)
|
||||
describe('PaymentChannel', PaymentChannelTest)
|
||||
describe('NegativeUNLTest', NegativeUNLTest)
|
||||
describe('OmitUndefined', omitUndefinedTest)
|
||||
describe('TicketTest', ticketTest)
|
||||
describe('NFToken', nfTokenTest)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user