Skip to content

Commit 8e2f659

Browse files
committed
remove some redundant serde stuff
1 parent 8c61fe7 commit 8e2f659

File tree

4 files changed

+104
-86
lines changed

4 files changed

+104
-86
lines changed

evm/ts/src/protocol/matchingEngine.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import { MatchingEngine } from "@wormhole-foundation/example-liquidity-layer-definitions";
1+
import {
2+
FastTransfer,
3+
MatchingEngine,
4+
} from "@wormhole-foundation/example-liquidity-layer-definitions";
25
import { Chain, Network } from "@wormhole-foundation/sdk-base";
36
import {
47
AccountAddress,
58
CircleBridge,
69
Contracts,
710
UnsignedTransaction,
811
VAA,
9-
keccak256,
1012
serialize,
1113
} from "@wormhole-foundation/sdk-definitions";
1214
import {
@@ -103,7 +105,7 @@ export class EvmMatchingEngine<N extends Network, C extends EvmChains>
103105
) {
104106
const from = new EvmAddress(sender).unwrap();
105107

106-
const auctionId = keccak256(vaa.hash);
108+
const auctionId = FastTransfer.auctionId(vaa);
107109

108110
// TODO: is this the correct amount to request for allowance here
109111
const { amount, securityDeposit } = await this.liveAuctionInfo(auctionId);

evm/ts/src/testing/utils.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ export function getSdkSigner<C extends EvmChains>(
2424
): SdkSigner<Network, C> {
2525
wallet = "reset" in wallet ? wallet : new ethers.NonceManager(wallet);
2626

27+
const address = (wallet.provider as unknown as ethers.Wallet).address;
28+
2729
return new SdkSigner(
2830
fromChain,
29-
"",
31+
address,
3032
// @ts-ignore -- incorrect ethers version
3133
wallet,
3234
);
@@ -61,12 +63,12 @@ export class SdkSigner<N extends Network, C extends EvmChains>
6163
e.info!.error.message === "nonce too low") ||
6264
isError(e, "NONCE_EXPIRED")
6365
) {
66+
// Sometimes it take a second for the mempool to update the new nonce
6467
await sleep(1);
6568
this.wallet.reset();
6669
const nonce = await this.wallet.getNonce("pending");
6770
if (this.opts?.debug)
6871
console.log("Setting nonce for", this.address(), " to ", nonce);
69-
7072
tx.transaction.nonce = nonce;
7173
continue;
7274
}

0 commit comments

Comments
 (0)