@xyo-network/xl1-protocol 1.12.16 → 1.12.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/neutral/payload/elevatable/Bridge/BridgeCompletion.d.ts +23 -0
- package/dist/neutral/payload/elevatable/Bridge/BridgeCompletion.d.ts.map +1 -0
- package/dist/neutral/payload/elevatable/Bridge/BridgeDetails.d.ts +39 -0
- package/dist/neutral/payload/elevatable/Bridge/BridgeDetails.d.ts.map +1 -0
- package/dist/neutral/payload/elevatable/Bridge/BridgeIntent.d.ts +11 -0
- package/dist/neutral/payload/elevatable/Bridge/BridgeIntent.d.ts.map +1 -0
- package/dist/neutral/payload/elevatable/Bridge/BridgeObservation.d.ts +25 -0
- package/dist/neutral/payload/elevatable/Bridge/BridgeObservation.d.ts.map +1 -0
- package/dist/neutral/payload/elevatable/Bridge/index.d.ts +4 -0
- package/dist/neutral/payload/elevatable/Bridge/index.d.ts.map +1 -0
- package/dist/neutral/payload/elevatable/Bridge/spec/Bridge.test.d.ts +2 -0
- package/dist/neutral/payload/elevatable/Bridge/spec/Bridge.test.d.ts.map +1 -0
- package/dist/neutral/payload/elevatable/index.d.ts +1 -0
- package/dist/neutral/payload/elevatable/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/payload/elevatable/Bridge/BridgeCompletion.ts +28 -0
- package/src/payload/elevatable/Bridge/BridgeDetails.ts +47 -0
- package/src/payload/elevatable/Bridge/BridgeIntent.ts +11 -0
- package/src/payload/elevatable/Bridge/BridgeObservation.ts +27 -0
- package/src/payload/elevatable/Bridge/index.ts +3 -0
- package/src/payload/elevatable/Bridge/spec/Bridge.test.ts +127 -0
- package/src/payload/elevatable/Bridge/spec/__snapshots__/Bridge.test.ts.snap +71 -0
- package/src/payload/elevatable/index.ts +1 -0
- package/src/validation/block/error.spec.ts +0 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Hash } from '@xylabs/hex';
|
|
2
|
+
/**
|
|
3
|
+
* Final confirmation tying the intent and the observation together.
|
|
4
|
+
*/
|
|
5
|
+
export interface BridgeCompletionFields {
|
|
6
|
+
/**
|
|
7
|
+
* Block number, event ID, or timestamp when the bridge was completed
|
|
8
|
+
*/
|
|
9
|
+
completedAt?: Hash;
|
|
10
|
+
/**
|
|
11
|
+
* Reference to observed destination confirmation hash
|
|
12
|
+
*/
|
|
13
|
+
destObservation: Hash;
|
|
14
|
+
/**
|
|
15
|
+
* Reference to source intent hash
|
|
16
|
+
*/
|
|
17
|
+
srcIntent?: Hash;
|
|
18
|
+
/**
|
|
19
|
+
* Reference to observed source confirmation hash
|
|
20
|
+
*/
|
|
21
|
+
srcObservation: Hash;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=BridgeCompletion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BridgeCompletion.d.ts","sourceRoot":"","sources":["../../../../../src/payload/elevatable/Bridge/BridgeCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IAErC;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAA;IAElB;;OAEG;IACH,eAAe,EAAE,IAAI,CAAA;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAA;IAEhB;;OAEG;IACH,cAAc,EAAE,IAAI,CAAA;CAErB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Hex } from '@xylabs/hex';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a transfer from a source chain/token/address to a destination chain/token/address.
|
|
4
|
+
*/
|
|
5
|
+
export interface BridgeDetailsFields {
|
|
6
|
+
/**
|
|
7
|
+
* Destination network
|
|
8
|
+
*/
|
|
9
|
+
dest: Hex;
|
|
10
|
+
/**
|
|
11
|
+
* Destination address (EOA or contract)
|
|
12
|
+
*/
|
|
13
|
+
destAddress: Hex;
|
|
14
|
+
/**
|
|
15
|
+
* Token amount to bridge to destination
|
|
16
|
+
*/
|
|
17
|
+
destAmount: Hex;
|
|
18
|
+
/**
|
|
19
|
+
* Token being bridged to
|
|
20
|
+
*/
|
|
21
|
+
destToken: Hex;
|
|
22
|
+
/**
|
|
23
|
+
* Source network
|
|
24
|
+
*/
|
|
25
|
+
src: Hex;
|
|
26
|
+
/**
|
|
27
|
+
* Source address (EOA or contract)
|
|
28
|
+
*/
|
|
29
|
+
srcAddress: Hex;
|
|
30
|
+
/**
|
|
31
|
+
* Token amount to bridge form source
|
|
32
|
+
*/
|
|
33
|
+
srcAmount: Hex;
|
|
34
|
+
/**
|
|
35
|
+
* Token being bridged from
|
|
36
|
+
*/
|
|
37
|
+
srcToken: Hex;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=BridgeDetails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BridgeDetails.d.ts","sourceRoot":"","sources":["../../../../../src/payload/elevatable/Bridge/BridgeDetails.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAElC;;OAEG;IACH,IAAI,EAAE,GAAG,CAAA;IAET;;OAEG;IACH,WAAW,EAAE,GAAG,CAAA;IAEhB;;OAEG;IACH,UAAU,EAAE,GAAG,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,GAAG,CAAA;IAEd;;OAEG;IACH,GAAG,EAAE,GAAG,CAAA;IAER;;OAEG;IACH,UAAU,EAAE,GAAG,CAAA;IAEf;;OAEG;IACH,SAAS,EAAE,GAAG,CAAA;IAEd;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAA;CACd"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BridgeDetailsFields } from './BridgeDetails.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an Addresses intent to initiate a token bridge.
|
|
4
|
+
*/
|
|
5
|
+
export interface BridgeIntentFields extends BridgeDetailsFields {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for replay protection
|
|
8
|
+
*/
|
|
9
|
+
nonce: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=BridgeIntent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BridgeIntent.d.ts","sourceRoot":"","sources":["../../../../../src/payload/elevatable/Bridge/BridgeIntent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Hex } from '@xylabs/hex';
|
|
2
|
+
import type { BridgeDetailsFields } from './BridgeDetails.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Represents an observation that confirms a bridge action occurred on the source chain.
|
|
5
|
+
*/
|
|
6
|
+
export interface BridgeSourceObservationFields extends BridgeDetailsFields {
|
|
7
|
+
/**
|
|
8
|
+
* Source chain confirmation
|
|
9
|
+
*/
|
|
10
|
+
srcConfirmation?: Hex;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Represents an observation that confirms a bridge action occurred on the destination chain.
|
|
14
|
+
*/
|
|
15
|
+
export interface BridgeDestinationObservationFields extends BridgeDetailsFields {
|
|
16
|
+
/**
|
|
17
|
+
* Destination chain confirmation
|
|
18
|
+
*/
|
|
19
|
+
destConfirmation?: Hex;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Represents an observation that confirms a bridge action occurred on either the source or destination chain.
|
|
23
|
+
*/
|
|
24
|
+
export type BridgeObservationFields = BridgeSourceObservationFields | BridgeDestinationObservationFields;
|
|
25
|
+
//# sourceMappingURL=BridgeObservation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BridgeObservation.d.ts","sourceRoot":"","sources":["../../../../../src/payload/elevatable/Bridge/BridgeObservation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB;IACxE;;OAEG;IACH,eAAe,CAAC,EAAE,GAAG,CAAA;CACtB;AACD;;GAEG;AACH,MAAM,WAAW,kCAAmC,SAAQ,mBAAmB;IAC7E;;OAEG;IACH,gBAAgB,CAAC,EAAE,GAAG,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,6BAA6B,GAAG,kCAAkC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/payload/elevatable/Bridge/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bridge.test.d.ts","sourceRoot":"","sources":["../../../../../../src/payload/elevatable/Bridge/spec/Bridge.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/payload/elevatable/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,sBAAsB,CAAA"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Hash } from '@xylabs/hex'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Final confirmation tying the intent and the observation together.
|
|
5
|
+
*/
|
|
6
|
+
export interface BridgeCompletionFields {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Block number, event ID, or timestamp when the bridge was completed
|
|
10
|
+
*/
|
|
11
|
+
completedAt?: Hash
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Reference to observed destination confirmation hash
|
|
15
|
+
*/
|
|
16
|
+
destObservation: Hash
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Reference to source intent hash
|
|
20
|
+
*/
|
|
21
|
+
srcIntent?: Hash
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Reference to observed source confirmation hash
|
|
25
|
+
*/
|
|
26
|
+
srcObservation: Hash
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Hex } from '@xylabs/hex'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a transfer from a source chain/token/address to a destination chain/token/address.
|
|
5
|
+
*/
|
|
6
|
+
export interface BridgeDetailsFields {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Destination network
|
|
10
|
+
*/
|
|
11
|
+
dest: Hex
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Destination address (EOA or contract)
|
|
15
|
+
*/
|
|
16
|
+
destAddress: Hex
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Token amount to bridge to destination
|
|
20
|
+
*/
|
|
21
|
+
destAmount: Hex
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Token being bridged to
|
|
25
|
+
*/
|
|
26
|
+
destToken: Hex
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Source network
|
|
30
|
+
*/
|
|
31
|
+
src: Hex
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Source address (EOA or contract)
|
|
35
|
+
*/
|
|
36
|
+
srcAddress: Hex
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Token amount to bridge form source
|
|
40
|
+
*/
|
|
41
|
+
srcAmount: Hex
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Token being bridged from
|
|
45
|
+
*/
|
|
46
|
+
srcToken: Hex
|
|
47
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BridgeDetailsFields } from './BridgeDetails.ts'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents an Addresses intent to initiate a token bridge.
|
|
5
|
+
*/
|
|
6
|
+
export interface BridgeIntentFields extends BridgeDetailsFields {
|
|
7
|
+
/**
|
|
8
|
+
* Unique identifier for replay protection
|
|
9
|
+
*/
|
|
10
|
+
nonce: string
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Hex } from '@xylabs/hex'
|
|
2
|
+
|
|
3
|
+
import type { BridgeDetailsFields } from './BridgeDetails.ts'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents an observation that confirms a bridge action occurred on the source chain.
|
|
7
|
+
*/
|
|
8
|
+
export interface BridgeSourceObservationFields extends BridgeDetailsFields {
|
|
9
|
+
/**
|
|
10
|
+
* Source chain confirmation
|
|
11
|
+
*/
|
|
12
|
+
srcConfirmation?: Hex
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Represents an observation that confirms a bridge action occurred on the destination chain.
|
|
16
|
+
*/
|
|
17
|
+
export interface BridgeDestinationObservationFields extends BridgeDetailsFields {
|
|
18
|
+
/**
|
|
19
|
+
* Destination chain confirmation
|
|
20
|
+
*/
|
|
21
|
+
destConfirmation?: Hex
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Represents an observation that confirms a bridge action occurred on either the source or destination chain.
|
|
26
|
+
*/
|
|
27
|
+
export type BridgeObservationFields = BridgeSourceObservationFields | BridgeDestinationObservationFields
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { toAddress, toHex } from '@xylabs/hex'
|
|
2
|
+
import {
|
|
3
|
+
describe, expect, it,
|
|
4
|
+
} from 'vitest'
|
|
5
|
+
|
|
6
|
+
import type { Chain } from '../../../../model.ts'
|
|
7
|
+
import { AttoXL1ConvertFactor } from '../../../../xl1/index.ts'
|
|
8
|
+
import type { BridgeIntentFields } from '../BridgeIntent.ts'
|
|
9
|
+
import type { BridgeObservationFields } from '../BridgeObservation.ts'
|
|
10
|
+
|
|
11
|
+
describe('Bridge', () => {
|
|
12
|
+
const srcAmount = toHex(100n * AttoXL1ConvertFactor.xl1) // 100 XL1 in AttoXL1
|
|
13
|
+
const destAmount = srcAmount // 1:1 for test
|
|
14
|
+
|
|
15
|
+
const xl1ChainId: Chain = toHex('dd381fbb392c85160d8b0453e446757b12384046')
|
|
16
|
+
const ethChainId = toHex('0x1')
|
|
17
|
+
|
|
18
|
+
const xl1Address = toAddress('1111111111111111111111111111111111111111')
|
|
19
|
+
const ethAddress = toAddress('0x2222222222222222222222222222222222222222')
|
|
20
|
+
|
|
21
|
+
const bridgeableTokenContract = toHex('0x3333333333333333333333333333333333333333')
|
|
22
|
+
|
|
23
|
+
const nonce = 'd5eeff33-d5bc-4aca-9ecb-3406c02a5dc4'
|
|
24
|
+
|
|
25
|
+
const xl1TxHash = toHex('0x4444444444444444444444444444444444444444444444444444444444444444') // Some XL1 tx hash
|
|
26
|
+
const ethTxHash = toHex('0x5555555555555555555555555555555555555555555555555555555555555555') // Some Eth tx hash
|
|
27
|
+
|
|
28
|
+
describe('XL1 to ETH', () => {
|
|
29
|
+
it('Sender issues BridgeIntent', () => {
|
|
30
|
+
const intent: BridgeIntentFields = {
|
|
31
|
+
// Source
|
|
32
|
+
src: xl1ChainId, // From XL1
|
|
33
|
+
srcAddress: xl1Address, // From XL1 sender
|
|
34
|
+
srcAmount,
|
|
35
|
+
srcToken: xl1ChainId, // In XL1
|
|
36
|
+
|
|
37
|
+
// Destination
|
|
38
|
+
dest: ethChainId, // To Ethereum
|
|
39
|
+
destAddress: ethAddress,
|
|
40
|
+
destAmount,
|
|
41
|
+
destToken: bridgeableTokenContract,
|
|
42
|
+
|
|
43
|
+
// Details
|
|
44
|
+
nonce,
|
|
45
|
+
}
|
|
46
|
+
expect(intent).toMatchSnapshot()
|
|
47
|
+
})
|
|
48
|
+
it('BridgeObservation (XL1 Side)', () => {
|
|
49
|
+
const observation: BridgeObservationFields = {
|
|
50
|
+
// Source
|
|
51
|
+
src: xl1ChainId, // From XL1
|
|
52
|
+
srcAddress: xl1Address, // From XL1 sender
|
|
53
|
+
srcAmount,
|
|
54
|
+
srcToken: xl1ChainId, // In XL1
|
|
55
|
+
|
|
56
|
+
// Destination
|
|
57
|
+
dest: ethChainId, // To Ethereum
|
|
58
|
+
destAddress: ethAddress,
|
|
59
|
+
destAmount,
|
|
60
|
+
destToken: bridgeableTokenContract,
|
|
61
|
+
|
|
62
|
+
// Observation
|
|
63
|
+
srcConfirmation: xl1TxHash,
|
|
64
|
+
}
|
|
65
|
+
expect(observation).toMatchSnapshot()
|
|
66
|
+
})
|
|
67
|
+
it('BridgeObservation (ETH Side)', () => {
|
|
68
|
+
const observation: BridgeObservationFields = {
|
|
69
|
+
// Source
|
|
70
|
+
src: xl1ChainId, // From XL1
|
|
71
|
+
srcAddress: xl1Address, // From XL1 sender
|
|
72
|
+
srcAmount,
|
|
73
|
+
srcToken: xl1ChainId, // In XL1
|
|
74
|
+
|
|
75
|
+
// Destination
|
|
76
|
+
dest: ethChainId, // To Ethereum
|
|
77
|
+
destAddress: ethAddress,
|
|
78
|
+
destAmount,
|
|
79
|
+
destToken: bridgeableTokenContract,
|
|
80
|
+
|
|
81
|
+
// Observation
|
|
82
|
+
destConfirmation: ethTxHash,
|
|
83
|
+
}
|
|
84
|
+
expect(observation).toMatchSnapshot()
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
describe('ETH to XL1', () => {
|
|
88
|
+
it('BridgeObservation (ETH Side)', () => {
|
|
89
|
+
const observation: BridgeObservationFields = {
|
|
90
|
+
// Source
|
|
91
|
+
src: ethChainId, // From Ethereum
|
|
92
|
+
srcToken: bridgeableTokenContract, // In Ethereum
|
|
93
|
+
srcAddress: ethAddress, // From Ethereum sender
|
|
94
|
+
srcAmount,
|
|
95
|
+
|
|
96
|
+
// Destination
|
|
97
|
+
dest: xl1ChainId, // To XL1
|
|
98
|
+
destToken: xl1ChainId, // In XL1
|
|
99
|
+
destAddress: xl1Address, // To XL1 Address
|
|
100
|
+
destAmount,
|
|
101
|
+
|
|
102
|
+
// Observation
|
|
103
|
+
srcConfirmation: ethTxHash,
|
|
104
|
+
}
|
|
105
|
+
expect(observation).toMatchSnapshot()
|
|
106
|
+
})
|
|
107
|
+
it('BridgeObservation (XL1 Side)', () => {
|
|
108
|
+
const observation: BridgeObservationFields = {
|
|
109
|
+
// Source
|
|
110
|
+
src: ethChainId, // From Ethereum
|
|
111
|
+
srcToken: bridgeableTokenContract, // In Ethereum
|
|
112
|
+
srcAddress: ethAddress, // From Ethereum sender
|
|
113
|
+
srcAmount,
|
|
114
|
+
|
|
115
|
+
// Destination
|
|
116
|
+
dest: xl1ChainId, // To XL1
|
|
117
|
+
destToken: xl1ChainId, // In XL1
|
|
118
|
+
destAddress: xl1Address, // To XL1 Address
|
|
119
|
+
destAmount,
|
|
120
|
+
|
|
121
|
+
// Observation
|
|
122
|
+
destConfirmation: xl1TxHash,
|
|
123
|
+
}
|
|
124
|
+
expect(observation).toMatchSnapshot()
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
})
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`Bridge > ETH to XL1 > BridgeObservation (ETH Side) 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"dest": "dd381fbb392c85160d8b0453e446757b12384046",
|
|
6
|
+
"destAddress": "1111111111111111111111111111111111111111",
|
|
7
|
+
"destAmount": "056bc75e2d63100000",
|
|
8
|
+
"destToken": "dd381fbb392c85160d8b0453e446757b12384046",
|
|
9
|
+
"src": "01",
|
|
10
|
+
"srcAddress": "2222222222222222222222222222222222222222",
|
|
11
|
+
"srcAmount": "056bc75e2d63100000",
|
|
12
|
+
"srcConfirmation": "5555555555555555555555555555555555555555555555555555555555555555",
|
|
13
|
+
"srcToken": "3333333333333333333333333333333333333333",
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
exports[`Bridge > ETH to XL1 > BridgeObservation (XL1 Side) 1`] = `
|
|
18
|
+
{
|
|
19
|
+
"dest": "dd381fbb392c85160d8b0453e446757b12384046",
|
|
20
|
+
"destAddress": "1111111111111111111111111111111111111111",
|
|
21
|
+
"destAmount": "056bc75e2d63100000",
|
|
22
|
+
"destConfirmation": "4444444444444444444444444444444444444444444444444444444444444444",
|
|
23
|
+
"destToken": "dd381fbb392c85160d8b0453e446757b12384046",
|
|
24
|
+
"src": "01",
|
|
25
|
+
"srcAddress": "2222222222222222222222222222222222222222",
|
|
26
|
+
"srcAmount": "056bc75e2d63100000",
|
|
27
|
+
"srcToken": "3333333333333333333333333333333333333333",
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
exports[`Bridge > XL1 to ETH > BridgeObservation (ETH Side) 1`] = `
|
|
32
|
+
{
|
|
33
|
+
"dest": "01",
|
|
34
|
+
"destAddress": "2222222222222222222222222222222222222222",
|
|
35
|
+
"destAmount": "056bc75e2d63100000",
|
|
36
|
+
"destConfirmation": "5555555555555555555555555555555555555555555555555555555555555555",
|
|
37
|
+
"destToken": "3333333333333333333333333333333333333333",
|
|
38
|
+
"src": "dd381fbb392c85160d8b0453e446757b12384046",
|
|
39
|
+
"srcAddress": "1111111111111111111111111111111111111111",
|
|
40
|
+
"srcAmount": "056bc75e2d63100000",
|
|
41
|
+
"srcToken": "dd381fbb392c85160d8b0453e446757b12384046",
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`Bridge > XL1 to ETH > BridgeObservation (XL1 Side) 1`] = `
|
|
46
|
+
{
|
|
47
|
+
"dest": "01",
|
|
48
|
+
"destAddress": "2222222222222222222222222222222222222222",
|
|
49
|
+
"destAmount": "056bc75e2d63100000",
|
|
50
|
+
"destToken": "3333333333333333333333333333333333333333",
|
|
51
|
+
"src": "dd381fbb392c85160d8b0453e446757b12384046",
|
|
52
|
+
"srcAddress": "1111111111111111111111111111111111111111",
|
|
53
|
+
"srcAmount": "056bc75e2d63100000",
|
|
54
|
+
"srcConfirmation": "4444444444444444444444444444444444444444444444444444444444444444",
|
|
55
|
+
"srcToken": "dd381fbb392c85160d8b0453e446757b12384046",
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
exports[`Bridge > XL1 to ETH > Sender issues BridgeIntent 1`] = `
|
|
60
|
+
{
|
|
61
|
+
"dest": "01",
|
|
62
|
+
"destAddress": "2222222222222222222222222222222222222222",
|
|
63
|
+
"destAmount": "056bc75e2d63100000",
|
|
64
|
+
"destToken": "3333333333333333333333333333333333333333",
|
|
65
|
+
"nonce": "d5eeff33-d5bc-4aca-9ecb-3406c02a5dc4",
|
|
66
|
+
"src": "dd381fbb392c85160d8b0453e446757b12384046",
|
|
67
|
+
"srcAddress": "1111111111111111111111111111111111111111",
|
|
68
|
+
"srcAmount": "056bc75e2d63100000",
|
|
69
|
+
"srcToken": "dd381fbb392c85160d8b0453e446757b12384046",
|
|
70
|
+
}
|
|
71
|
+
`;
|