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:
Mayukha Vadari
2023-10-25 10:08:58 -04:00
committed by GitHub
parent a11924b8fc
commit 68beac73d1
16 changed files with 966 additions and 37 deletions

View File

@@ -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))
}
/**