From 90bc5e07075a5f92654c0f1da83e8272504ccf1f Mon Sep 17 00:00:00 2001 From: Jan-Felix Date: Thu, 1 Aug 2024 12:43:59 +0200 Subject: [PATCH 1/2] fix connect button issue after creating fresh connection --- extension/src/routes/RoutesDrawer/ConnectButton/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extension/src/routes/RoutesDrawer/ConnectButton/index.tsx b/extension/src/routes/RoutesDrawer/ConnectButton/index.tsx index d4a8ea49..ad463196 100644 --- a/extension/src/routes/RoutesDrawer/ConnectButton/index.tsx +++ b/extension/src/routes/RoutesDrawer/ConnectButton/index.tsx @@ -19,6 +19,7 @@ import { asLegacyConnection, fromLegacyConnection, } from '../../legacyConnectionMigrations' +import { ZeroAddress } from 'ethers' const walletConnectLogo = ( wallet connect logo @@ -34,8 +35,9 @@ const metamaskLogo = ( const ConnectButton: React.FC<{ id: string }> = ({ id }) => { const [routes, setRoutes] = useRoutes() const { connected, route, chainId } = useRoute(id) - const pilotAddress = + let pilotAddress = route.initiator && parsePrefixedAddress(route.initiator)[1].toLowerCase() + if (pilotAddress === ZeroAddress) pilotAddress = '' const metamask = useMetaMask() const walletConnect = useWalletConnect(route.id) From a173c50a4b1cd063aafdcc9b6509802d2867ccfb Mon Sep 17 00:00:00 2001 From: Jan-Felix Date: Thu, 1 Aug 2024 12:48:29 +0200 Subject: [PATCH 2/2] set next block timestamp to fix simulation issue with cow order signer --- extension/src/providers/ForkProvider.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/extension/src/providers/ForkProvider.ts b/extension/src/providers/ForkProvider.ts index edbe3eef..5d67021e 100644 --- a/extension/src/providers/ForkProvider.ts +++ b/extension/src/providers/ForkProvider.ts @@ -176,12 +176,13 @@ class ForkProvider extends EventEmitter { const checkpointId: string = await this.provider.request({ method: 'evm_snapshot', }) - this.handlers.onBeforeTransactionSend(checkpointId, metaTx) - console.log({ - mod: this.moduleAddress, - ava: this.avatarAddress, - own: this.ownerAddress, + await this.provider.request({ + method: 'evm_setNextBlockTimestamp', + params: [Math.ceil(Date.now() / 1000).toString()], }) + + this.handlers.onBeforeTransactionSend(checkpointId, metaTx) + // correctly route the meta tx through the avatar let tx: TransactionData & TransactionOptions if (this.moduleAddress) {