From 12d28ef003bbadc52f3fb032cba9a52f300ac163 Mon Sep 17 00:00:00 2001 From: notV4l <122404722+notV4l@users.noreply.github.com> Date: Sun, 17 Nov 2024 20:17:51 +0100 Subject: [PATCH] Fix update config (#390) * fix update config --- web/src/components/wallet/StarknetProvider.tsx | 7 ++++--- web/src/dojo/hooks/useSystems.ts | 13 ++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/web/src/components/wallet/StarknetProvider.tsx b/web/src/components/wallet/StarknetProvider.tsx index 1c29950d..70e63c45 100644 --- a/web/src/components/wallet/StarknetProvider.tsx +++ b/web/src/components/wallet/StarknetProvider.tsx @@ -38,9 +38,7 @@ export function customJsonRpcProvider(selectedChain: DojoChainConfig): ChainProv function getConnectorsForChain(selectedChain: DojoChainConfig, path: string) { const controller = cartridgeConnector({ selectedChain }); - if (path.startsWith("/admin")) { - return [controller, argent()]; - } + switch (selectedChain.name) { case "KATANA": @@ -60,6 +58,9 @@ function getConnectorsForChain(selectedChain: DojoChainConfig, path: string) { default: // const controller = cartridgeConnector({ selectedChain }); + if (path.startsWith("/admin")) { + return [controller, argent()]; + } return [controller]; } } diff --git a/web/src/dojo/hooks/useSystems.ts b/web/src/dojo/hooks/useSystems.ts index c704baf4..4db0a878 100644 --- a/web/src/dojo/hooks/useSystems.ts +++ b/web/src/dojo/hooks/useSystems.ts @@ -390,7 +390,18 @@ export const useSystems = (): SystemsInterface => { const { hash } = await executeAndReceipt({ contractName: `ryo`, entrypoint: "update_ryo_config", - calldata: [ryoConfig], + calldata: CallData.compile({ + key: 0, // ignored in contract + initialized: 0, // ignored in contract + paused: 0, // ignored in contract + season_version: 0, // ignored in contract + season_duration: ryoConfig.season_duration, + season_time_limit: ryoConfig.season_time_limit, + paper_fee: ryoConfig.paper_fee, + paper_reward_launderer: ryoConfig.paper_reward_launderer, + treasury_fee_pct: ryoConfig.treasury_fee_pct, + treasury_balance: 0, // ignored in contract + }), }); return {