From a161715897df716e162a077ab1f88a621efa4319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Tkaczy=C5=84ski?= Date: Mon, 28 Oct 2024 11:31:24 +0100 Subject: [PATCH] feat: EthRelayer execution fixes (#937) * fix: show message if max. end has not been reached EthRelayer requires proposal max end to be reached. https://github.com/snapshot-labs/sx-starknet/blob/af131eb27748671dae5700f6c13c08d622e58383/starknet/src/execution_strategies/eth_relayer.cairo#L35-L41 * fix: always format l1destination address --- apps/api/src/utils.ts | 4 ++-- apps/ui/src/composables/useExecutionActions.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/api/src/utils.ts b/apps/api/src/utils.ts index 116adea95..dd6d50ae6 100644 --- a/apps/api/src/utils.ts +++ b/apps/api/src/utils.ts @@ -168,10 +168,10 @@ export async function handleExecutionStrategy( const [l1Destination] = payload; if (!l1Destination) throw new Error('Invalid payload for EthRelayer execution strategy'); - destinationAddress = l1Destination; + destinationAddress = formatAddress('Ethereum', l1Destination); const SimpleQuorumExecutionStrategyContract = new EthContract( - l1Destination, + destinationAddress, SimpleQuorumExecutionStrategyAbi, ethProvider ); diff --git a/apps/ui/src/composables/useExecutionActions.ts b/apps/ui/src/composables/useExecutionActions.ts index c4b93fca6..46a89a2af 100644 --- a/apps/ui/src/composables/useExecutionActions.ts +++ b/apps/ui/src/composables/useExecutionActions.ts @@ -75,6 +75,11 @@ export function useExecutionActions( }); async function fetchEthRelayerExecutionDetails() { + if (currentTimestamp.value < proposal.max_end * 1000) { + message.value = + 'This execution strategy requires max end time to be reached.'; + } + if (!proposal.execution_tx) return; const tx = await network.value.helpers.getTransaction(