@across-protocol/sdk 4.3.150 → 4.3.152
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/cjs/src/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/cjs/src/arch/svm/eventsClient.js +2 -10
- package/dist/cjs/src/arch/svm/eventsClient.js.map +1 -1
- package/dist/cjs/src/arch/svm/utils.d.ts +1 -1
- package/dist/cjs/src/arch/svm/utils.js +13 -3
- package/dist/cjs/src/arch/svm/utils.js.map +1 -1
- package/dist/cjs/src/clients/SpokePoolClient/SVMSpokePoolClient.js +1 -1
- package/dist/cjs/src/clients/SpokePoolClient/SVMSpokePoolClient.js.map +1 -1
- package/dist/cjs/src/clients/SpokePoolClient/SpokePoolClient.js +9 -7
- package/dist/cjs/src/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
- package/dist/cjs/src/clients/mocks/MockConfigStoreClient.d.ts +4 -2
- package/dist/cjs/src/clients/mocks/MockConfigStoreClient.js +8 -3
- package/dist/cjs/src/clients/mocks/MockConfigStoreClient.js.map +1 -1
- package/dist/cjs/src/clients/mocks/MockEvents.d.ts +1 -1
- package/dist/cjs/src/clients/mocks/MockEvents.js +5 -12
- package/dist/cjs/src/clients/mocks/MockEvents.js.map +1 -1
- package/dist/cjs/src/clients/mocks/MockHubPoolClient.d.ts +4 -2
- package/dist/cjs/src/clients/mocks/MockHubPoolClient.js +3 -2
- package/dist/cjs/src/clients/mocks/MockHubPoolClient.js.map +1 -1
- package/dist/cjs/src/clients/mocks/MockSpokePoolClient.d.ts +2 -1
- package/dist/cjs/src/clients/mocks/MockSpokePoolClient.js +4 -3
- package/dist/cjs/src/clients/mocks/MockSpokePoolClient.js.map +1 -1
- package/dist/cjs/src/clients/mocks/MockSvmSpokePoolClient.js +1 -1
- package/dist/cjs/src/clients/mocks/MockSvmSpokePoolClient.js.map +1 -1
- package/dist/cjs/src/clients/mocks/index.d.ts +1 -0
- package/dist/cjs/src/clients/mocks/index.js +1 -0
- package/dist/cjs/src/clients/mocks/index.js.map +1 -1
- package/dist/cjs/src/utils/SpokeUtils.js +25 -25
- package/dist/cjs/src/utils/SpokeUtils.js.map +1 -1
- package/dist/esm/src/arch/svm/SpokeUtils.js.map +1 -1
- package/dist/esm/src/arch/svm/eventsClient.js +2 -10
- package/dist/esm/src/arch/svm/eventsClient.js.map +1 -1
- package/dist/esm/src/arch/svm/utils.d.ts +5 -3
- package/dist/esm/src/arch/svm/utils.js +25 -5
- package/dist/esm/src/arch/svm/utils.js.map +1 -1
- package/dist/esm/src/clients/SpokePoolClient/SVMSpokePoolClient.js +1 -1
- package/dist/esm/src/clients/SpokePoolClient/SVMSpokePoolClient.js.map +1 -1
- package/dist/esm/src/clients/SpokePoolClient/SpokePoolClient.js +9 -7
- package/dist/esm/src/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
- package/dist/esm/src/clients/mocks/MockConfigStoreClient.d.ts +4 -2
- package/dist/esm/src/clients/mocks/MockConfigStoreClient.js +10 -5
- package/dist/esm/src/clients/mocks/MockConfigStoreClient.js.map +1 -1
- package/dist/esm/src/clients/mocks/MockEvents.d.ts +1 -8
- package/dist/esm/src/clients/mocks/MockEvents.js +7 -18
- package/dist/esm/src/clients/mocks/MockEvents.js.map +1 -1
- package/dist/esm/src/clients/mocks/MockHubPoolClient.d.ts +4 -2
- package/dist/esm/src/clients/mocks/MockHubPoolClient.js +5 -4
- package/dist/esm/src/clients/mocks/MockHubPoolClient.js.map +1 -1
- package/dist/esm/src/clients/mocks/MockSpokePoolClient.d.ts +2 -1
- package/dist/esm/src/clients/mocks/MockSpokePoolClient.js +5 -4
- package/dist/esm/src/clients/mocks/MockSpokePoolClient.js.map +1 -1
- package/dist/esm/src/clients/mocks/MockSvmSpokePoolClient.js +1 -1
- package/dist/esm/src/clients/mocks/MockSvmSpokePoolClient.js.map +1 -1
- package/dist/esm/src/clients/mocks/index.d.ts +1 -0
- package/dist/esm/src/clients/mocks/index.js +1 -0
- package/dist/esm/src/clients/mocks/index.js.map +1 -1
- package/dist/esm/src/utils/SpokeUtils.js +25 -25
- package/dist/esm/src/utils/SpokeUtils.js.map +1 -1
- package/dist/types/src/arch/svm/eventsClient.d.ts.map +1 -1
- package/dist/types/src/arch/svm/utils.d.ts +5 -3
- package/dist/types/src/arch/svm/utils.d.ts.map +1 -1
- package/dist/types/src/clients/SpokePoolClient/SpokePoolClient.d.ts.map +1 -1
- package/dist/types/src/clients/mocks/MockConfigStoreClient.d.ts +4 -2
- package/dist/types/src/clients/mocks/MockConfigStoreClient.d.ts.map +1 -1
- package/dist/types/src/clients/mocks/MockEvents.d.ts +1 -8
- package/dist/types/src/clients/mocks/MockEvents.d.ts.map +1 -1
- package/dist/types/src/clients/mocks/MockHubPoolClient.d.ts +4 -2
- package/dist/types/src/clients/mocks/MockHubPoolClient.d.ts.map +1 -1
- package/dist/types/src/clients/mocks/MockSpokePoolClient.d.ts +2 -1
- package/dist/types/src/clients/mocks/MockSpokePoolClient.d.ts.map +1 -1
- package/dist/types/src/clients/mocks/index.d.ts +1 -0
- package/dist/types/src/clients/mocks/index.d.ts.map +1 -1
- package/dist/types/src/utils/SpokeUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/arch/svm/SpokeUtils.ts +2 -2
- package/src/arch/svm/eventsClient.ts +18 -32
- package/src/arch/svm/utils.ts +27 -5
- package/src/clients/SpokePoolClient/SVMSpokePoolClient.ts +1 -1
- package/src/clients/SpokePoolClient/SpokePoolClient.ts +10 -8
- package/src/clients/mocks/MockConfigStoreClient.ts +11 -13
- package/src/clients/mocks/MockEvents.ts +8 -24
- package/src/clients/mocks/MockHubPoolClient.ts +6 -4
- package/src/clients/mocks/MockSpokePoolClient.ts +5 -4
- package/src/clients/mocks/MockSvmSpokePoolClient.ts +1 -1
- package/src/clients/mocks/index.ts +1 -0
- package/src/utils/SpokeUtils.ts +26 -25
|
@@ -155,11 +155,11 @@ export class SVMSpokePoolClient extends SpokePoolClient {
|
|
|
155
155
|
);
|
|
156
156
|
return events.map(
|
|
157
157
|
(event): SortableEvent => ({
|
|
158
|
+
...unwrapEventData(event.data),
|
|
158
159
|
txnRef: event.signature,
|
|
159
160
|
blockNumber: Number(event.slot),
|
|
160
161
|
txnIndex: 0,
|
|
161
162
|
logIndex: 0,
|
|
162
|
-
...(unwrapEventData(event.data) as Record<string, unknown>),
|
|
163
163
|
})
|
|
164
164
|
);
|
|
165
165
|
}),
|
|
@@ -501,7 +501,7 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
501
501
|
* @see _update
|
|
502
502
|
*/
|
|
503
503
|
public async update(eventsToQuery = this._queryableEventNames()): Promise<void> {
|
|
504
|
-
const duplicateEvents: SortableEvent[] = [];
|
|
504
|
+
const duplicateEvents: { incoming: SortableEvent; existing: SortableEvent }[] = [];
|
|
505
505
|
if (this.hubPoolClient !== null && !this.hubPoolClient.isUpdated) {
|
|
506
506
|
throw new Error("HubPoolClient not updated");
|
|
507
507
|
}
|
|
@@ -552,8 +552,9 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
552
552
|
if (this.depositHashes[getRelayEventKey(deposit)] !== undefined) {
|
|
553
553
|
// Sanity check that this event is not a duplicate, even though the relay data hash is a duplicate.
|
|
554
554
|
const allDeposits = this._getDuplicateDeposits(deposit).concat(this.depositHashes[getRelayEventKey(deposit)]);
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
const existing = allDeposits.find((e) => duplicateEvent(deposit, e));
|
|
556
|
+
if (existing !== undefined) {
|
|
557
|
+
duplicateEvents.push({ incoming: deposit, existing });
|
|
557
558
|
continue;
|
|
558
559
|
}
|
|
559
560
|
assign(this.duplicateDepositHashes, [getRelayEventKey(deposit)], [deposit]);
|
|
@@ -650,8 +651,9 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
650
651
|
const depositHash = getRelayEventKey(slowFillRequest);
|
|
651
652
|
|
|
652
653
|
// Sanity check that this event is not a duplicate.
|
|
653
|
-
|
|
654
|
-
|
|
654
|
+
const existing = this.slowFillRequests[depositHash];
|
|
655
|
+
if (existing !== undefined) {
|
|
656
|
+
duplicateEvents.push({ incoming: slowFillRequest, existing });
|
|
655
657
|
continue;
|
|
656
658
|
}
|
|
657
659
|
|
|
@@ -680,9 +682,9 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
680
682
|
// test that the types are complete. A broader change in strategy for safely unpacking events will be introduced.
|
|
681
683
|
for (const fill of fillEvents) {
|
|
682
684
|
// Sanity check that this event is not a duplicate.
|
|
683
|
-
const
|
|
684
|
-
if (
|
|
685
|
-
duplicateEvents.push(fill);
|
|
685
|
+
const existing = this.fills[fill.originChainId]?.find((f) => duplicateEvent(fill, f));
|
|
686
|
+
if (existing !== undefined) {
|
|
687
|
+
duplicateEvents.push({ incoming: fill, existing });
|
|
686
688
|
continue;
|
|
687
689
|
}
|
|
688
690
|
|
|
@@ -2,21 +2,15 @@ import assert from "assert";
|
|
|
2
2
|
import winston from "winston";
|
|
3
3
|
import { Contract, ethers } from "ethers";
|
|
4
4
|
import { Log } from "../../interfaces";
|
|
5
|
-
import {
|
|
6
|
-
getCurrentTime,
|
|
7
|
-
EventSearchConfig,
|
|
8
|
-
MakeOptional,
|
|
9
|
-
isDefined,
|
|
10
|
-
utf8ToHex,
|
|
11
|
-
spreadEventWithBlockNumber,
|
|
12
|
-
} from "../../utils";
|
|
5
|
+
import { getCurrentTime, EventSearchConfig, MakeOptional, utf8ToHex, spreadEventWithBlockNumber } from "../../utils";
|
|
13
6
|
import {
|
|
14
7
|
AcrossConfigStoreClient,
|
|
15
8
|
ConfigStoreUpdate,
|
|
16
9
|
DEFAULT_CONFIG_STORE_VERSION,
|
|
17
10
|
GLOBAL_CONFIG_STORE_KEYS,
|
|
18
11
|
} from "../AcrossConfigStoreClient";
|
|
19
|
-
import {
|
|
12
|
+
import { CHAIN_IDs } from "../../constants";
|
|
13
|
+
import { EventManager, EventOverrides } from "./MockEvents";
|
|
20
14
|
|
|
21
15
|
export class MockConfigStoreClient extends AcrossConfigStoreClient {
|
|
22
16
|
public configStoreVersion = DEFAULT_CONFIG_STORE_VERSION;
|
|
@@ -35,17 +29,21 @@ export class MockConfigStoreClient extends AcrossConfigStoreClient {
|
|
|
35
29
|
configStore: Contract,
|
|
36
30
|
eventSearchConfig: MakeOptional<EventSearchConfig, "to"> = { from: 0, maxLookBack: 0 },
|
|
37
31
|
configStoreVersion: number,
|
|
38
|
-
chainId =
|
|
32
|
+
chainId = CHAIN_IDs.MAINNET,
|
|
39
33
|
mockUpdate = false,
|
|
40
|
-
availableChainIdsOverride?: number[]
|
|
34
|
+
availableChainIdsOverride?: number[],
|
|
35
|
+
opts: { eventManager?: EventManager } = {}
|
|
41
36
|
) {
|
|
42
37
|
super(logger, configStore, eventSearchConfig, configStoreVersion);
|
|
43
38
|
this.chainId = chainId;
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
if (mockUpdate) {
|
|
40
|
+
this.eventManager = opts.eventManager ?? new EventManager();
|
|
41
|
+
this.eventManager.addEventSignatures(this.eventSignatures);
|
|
46
42
|
this.updateGlobalConfig(GLOBAL_CONFIG_STORE_KEYS.CHAIN_ID_INDICES, JSON.stringify(availableChainIdsOverride), {
|
|
47
43
|
blockNumber: this.eventManager.blockNumber,
|
|
48
44
|
});
|
|
45
|
+
} else {
|
|
46
|
+
this.eventManager = null;
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
49
|
|
|
@@ -20,8 +20,6 @@ type EthersEventTemplate = {
|
|
|
20
20
|
transactionIndex?: number;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
const eventManagers: { [chainId: number]: EventManager } = {};
|
|
24
|
-
|
|
25
23
|
export class EventManager {
|
|
26
24
|
private logIndexes: Record<string, number> = {};
|
|
27
25
|
public events: Log[] = [];
|
|
@@ -49,6 +47,14 @@ export class EventManager {
|
|
|
49
47
|
return events;
|
|
50
48
|
}
|
|
51
49
|
|
|
50
|
+
// Reset internal state. Useful when a long-lived EventManager instance is
|
|
51
|
+
// reused across test contexts that begin at different block numbers.
|
|
52
|
+
reset(blockNumber = 0): void {
|
|
53
|
+
this.blockNumber = blockNumber;
|
|
54
|
+
this.logIndexes = {};
|
|
55
|
+
this.events = [];
|
|
56
|
+
}
|
|
57
|
+
|
|
52
58
|
generateEvent(inputs: EthersEventTemplate): Log {
|
|
53
59
|
const { address, event, topics, data, args } = inputs;
|
|
54
60
|
let { blockNumber, transactionIndex } = inputs;
|
|
@@ -82,25 +88,3 @@ export class EventManager {
|
|
|
82
88
|
return generatedEvent;
|
|
83
89
|
}
|
|
84
90
|
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @description Retrieve an instance of the EventManager for a specific chain, or instantiate a new one.
|
|
88
|
-
* @param chainId Chain ID to retrieve EventManager for.
|
|
89
|
-
* @param eventSignatures Event Signatures to append to EventManager instance.
|
|
90
|
-
* @param Initial blockNumber to use if a new EventManager is instantiated.
|
|
91
|
-
* @returns EventManager instance for chain ID.
|
|
92
|
-
*/
|
|
93
|
-
export function getEventManager(
|
|
94
|
-
chainId: number,
|
|
95
|
-
eventSignatures?: Record<string, string>,
|
|
96
|
-
blockNumber?: number
|
|
97
|
-
): EventManager {
|
|
98
|
-
if (!isDefined(eventManagers[chainId])) {
|
|
99
|
-
eventManagers[chainId] = new EventManager(blockNumber);
|
|
100
|
-
}
|
|
101
|
-
const eventManager = eventManagers[chainId];
|
|
102
|
-
if (isDefined(eventSignatures)) {
|
|
103
|
-
eventManager.addEventSignatures(eventSignatures);
|
|
104
|
-
}
|
|
105
|
-
return eventManager;
|
|
106
|
-
}
|
|
@@ -4,8 +4,8 @@ import { BigNumber, randomAddress, assign, bnZero, toAddressType, EvmAddress, Ad
|
|
|
4
4
|
import { Log, PendingRootBundle, RealizedLpFee, L1TokenInfo } from "../../interfaces";
|
|
5
5
|
import { AcrossConfigStoreClient as ConfigStoreClient } from "../AcrossConfigStoreClient";
|
|
6
6
|
import { HubPoolClient, HubPoolUpdate, LpFeeRequest } from "../HubPoolClient";
|
|
7
|
-
import { EventManager, EventOverrides
|
|
8
|
-
import { ZERO_ADDRESS } from "../../constants";
|
|
7
|
+
import { EventManager, EventOverrides } from "./MockEvents";
|
|
8
|
+
import { CHAIN_IDs, ZERO_ADDRESS } from "../../constants";
|
|
9
9
|
|
|
10
10
|
const emptyRootBundle: PendingRootBundle = {
|
|
11
11
|
poolRebalanceRoot: "",
|
|
@@ -34,10 +34,12 @@ export class MockHubPoolClient extends HubPoolClient {
|
|
|
34
34
|
hubPool: Contract,
|
|
35
35
|
configStoreClient: ConfigStoreClient,
|
|
36
36
|
deploymentBlock = 0,
|
|
37
|
-
chainId =
|
|
37
|
+
chainId = CHAIN_IDs.MAINNET,
|
|
38
|
+
opts: { eventManager?: EventManager } = {}
|
|
38
39
|
) {
|
|
39
40
|
super(logger, hubPool, configStoreClient, deploymentBlock, chainId);
|
|
40
|
-
this.eventManager =
|
|
41
|
+
this.eventManager = opts.eventManager ?? new EventManager(deploymentBlock);
|
|
42
|
+
this.eventManager.addEventSignatures(this.eventSignatures);
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
setDefaultRealizedLpFeePct(fee: BigNumber): void {
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
} from "../../utils";
|
|
34
34
|
import { EVMSpokePoolClient, SpokePoolUpdate } from "../SpokePoolClient";
|
|
35
35
|
import { HubPoolClient } from "../HubPoolClient";
|
|
36
|
-
import { EventManager, EventOverrides
|
|
36
|
+
import { EventManager, EventOverrides } from "./MockEvents";
|
|
37
37
|
import { AcrossConfigStoreClient } from "../AcrossConfigStoreClient";
|
|
38
38
|
|
|
39
39
|
// This class replaces internal SpokePoolClient functionality, enabling
|
|
@@ -50,11 +50,12 @@ export class MockSpokePoolClient extends EVMSpokePoolClient {
|
|
|
50
50
|
spokePool: Contract,
|
|
51
51
|
chainId: number,
|
|
52
52
|
deploymentBlock: number,
|
|
53
|
-
opts: { hubPoolClient
|
|
53
|
+
opts: { hubPoolClient?: HubPoolClient | null; eventManager?: EventManager } = {}
|
|
54
54
|
) {
|
|
55
|
-
super(logger, spokePool, opts.hubPoolClient, chainId, deploymentBlock);
|
|
55
|
+
super(logger, spokePool, opts.hubPoolClient ?? null, chainId, deploymentBlock);
|
|
56
56
|
this.latestHeightSearched = deploymentBlock;
|
|
57
|
-
this.eventManager =
|
|
57
|
+
this.eventManager = opts.eventManager ?? new EventManager(deploymentBlock);
|
|
58
|
+
this.eventManager.addEventSignatures(this.eventSignatures);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
setConfigStoreClient(configStore?: AcrossConfigStoreClient): void {
|
|
@@ -75,11 +75,11 @@ export class MockSvmSpokePoolClient extends SVMSpokePoolClient {
|
|
|
75
75
|
const eventsWithBlockNumber = events.map((eventList) =>
|
|
76
76
|
eventList.map((event) => {
|
|
77
77
|
return {
|
|
78
|
+
...unwrapEventData(event.data),
|
|
78
79
|
txnRef: event.signature,
|
|
79
80
|
blockNumber: Number(event.slot),
|
|
80
81
|
txnIndex: 0,
|
|
81
82
|
logIndex: 0,
|
|
82
|
-
...(unwrapEventData(event.data) as Record<string, unknown>),
|
|
83
83
|
};
|
|
84
84
|
})
|
|
85
85
|
);
|
package/src/utils/SpokeUtils.ts
CHANGED
|
@@ -113,6 +113,27 @@ export function unpackFillEvent(rawEvent: SortableEvent, destinationChainId: num
|
|
|
113
113
|
} satisfies FillWithBlock;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
const RELAYDATA_ABI = [
|
|
117
|
+
{
|
|
118
|
+
type: "tuple",
|
|
119
|
+
components: [
|
|
120
|
+
{ type: "bytes32", name: "depositor" },
|
|
121
|
+
{ type: "bytes32", name: "recipient" },
|
|
122
|
+
{ type: "bytes32", name: "exclusiveRelayer" },
|
|
123
|
+
{ type: "bytes32", name: "inputToken" },
|
|
124
|
+
{ type: "bytes32", name: "outputToken" },
|
|
125
|
+
{ type: "uint256", name: "inputAmount" },
|
|
126
|
+
{ type: "uint256", name: "outputAmount" },
|
|
127
|
+
{ type: "uint256", name: "originChainId" },
|
|
128
|
+
{ type: "uint256", name: "depositId" },
|
|
129
|
+
{ type: "uint32", name: "fillDeadline" },
|
|
130
|
+
{ type: "uint32", name: "exclusivityDeadline" },
|
|
131
|
+
{ type: "bytes", name: "message" },
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
{ type: "uint256", name: "destinationChainId" },
|
|
135
|
+
];
|
|
136
|
+
|
|
116
137
|
/**
|
|
117
138
|
* Compute the RelayData hash for a fill. This can be used to determine the fill status.
|
|
118
139
|
* @param relayData RelayData information that is used to complete a fill.
|
|
@@ -120,26 +141,10 @@ export function unpackFillEvent(rawEvent: SortableEvent, destinationChainId: num
|
|
|
120
141
|
* @returns The corresponding RelayData hash.
|
|
121
142
|
*/
|
|
122
143
|
export function getRelayDataHash(relayData: RelayData, destinationChainId: number): string {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
{ type: "bytes32", name: "depositor" },
|
|
128
|
-
{ type: "bytes32", name: "recipient" },
|
|
129
|
-
{ type: "bytes32", name: "exclusiveRelayer" },
|
|
130
|
-
{ type: "bytes32", name: "inputToken" },
|
|
131
|
-
{ type: "bytes32", name: "outputToken" },
|
|
132
|
-
{ type: "uint256", name: "inputAmount" },
|
|
133
|
-
{ type: "uint256", name: "outputAmount" },
|
|
134
|
-
{ type: "uint256", name: "originChainId" },
|
|
135
|
-
{ type: "uint256", name: "depositId" },
|
|
136
|
-
{ type: "uint32", name: "fillDeadline" },
|
|
137
|
-
{ type: "uint32", name: "exclusivityDeadline" },
|
|
138
|
-
{ type: "bytes", name: "message" },
|
|
139
|
-
],
|
|
140
|
-
},
|
|
141
|
-
{ type: "uint256", name: "destinationChainId" },
|
|
142
|
-
];
|
|
144
|
+
if (chainIsSvm(destinationChainId)) {
|
|
145
|
+
const messageHash = getMessageHash(relayData.message);
|
|
146
|
+
return svm.getRelayDataHash({ ...relayData, messageHash }, destinationChainId);
|
|
147
|
+
}
|
|
143
148
|
|
|
144
149
|
const _relayData = {
|
|
145
150
|
...relayData,
|
|
@@ -149,11 +154,7 @@ export function getRelayDataHash(relayData: RelayData, destinationChainId: numbe
|
|
|
149
154
|
outputToken: relayData.outputToken.toBytes32(),
|
|
150
155
|
exclusiveRelayer: relayData.exclusiveRelayer.toBytes32(),
|
|
151
156
|
};
|
|
152
|
-
|
|
153
|
-
const messageHash = getMessageHash(relayData.message);
|
|
154
|
-
return svm.getRelayDataHash({ ...relayData, messageHash }, destinationChainId);
|
|
155
|
-
}
|
|
156
|
-
return keccak256(encodeAbiParameters(abi, [_relayData, destinationChainId]));
|
|
157
|
+
return keccak256(encodeAbiParameters(RELAYDATA_ABI, [_relayData, destinationChainId]));
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
export function getRelayHashFromEvent(e: RelayData & { destinationChainId: number }): string {
|