mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-18 03:05:48 +00:00
test: add integration tests for sidechain transactions (#2301)
* add XChainCreateBridge integration test * add XChainCreateClaimID integration test * add XChainCommit integration test * add XChainAccountCreateCommit integration test * simplify tests * add XChainModifyBridge integration test * add XChainAddAccountCreateAttestation integration test * add XChainAddClaimAttestation integration test * improve SignerListSet integration test * rename variable to match * add XChainClaim integration test * clean up * add IOU attestation test * fix integration tests issues * minor refactors * fix bug * [WIP] switch to one bridge for all integration tests * clean up * fix tests * fix + clean up tests
This commit is contained in:
@@ -67,20 +67,20 @@ class XChainBridge extends SerializedType {
|
||||
return value
|
||||
}
|
||||
|
||||
if (isXChainBridgeObject(value)) {
|
||||
const bytes: Array<Buffer> = []
|
||||
this.TYPE_ORDER.forEach((item) => {
|
||||
const { name, type } = item
|
||||
if (type === AccountID) {
|
||||
bytes.push(Buffer.from([0x14]))
|
||||
}
|
||||
const object = type.from(value[name])
|
||||
bytes.push(object.toBytes())
|
||||
})
|
||||
return new XChainBridge(Buffer.concat(bytes))
|
||||
if (!isXChainBridgeObject(value)) {
|
||||
throw new Error('Invalid type to construct an XChainBridge')
|
||||
}
|
||||
|
||||
throw new Error('Invalid type to construct an XChainBridge')
|
||||
const bytes: Array<Buffer> = []
|
||||
this.TYPE_ORDER.forEach((item) => {
|
||||
const { name, type } = item
|
||||
if (type === AccountID) {
|
||||
bytes.push(Buffer.from([0x14]))
|
||||
}
|
||||
const object = type.from(value[name])
|
||||
bytes.push(object.toBytes())
|
||||
})
|
||||
return new XChainBridge(Buffer.concat(bytes))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user