From 088724c798e24e9ae966cea24f21537571344738 Mon Sep 17 00:00:00 2001 From: noah Date: Wed, 13 Dec 2023 11:36:08 -0800 Subject: [PATCH] Fix polytone authz exec. (#1516) --- .../actions/core/authorizations/AuthzExec/index.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx b/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx index 602f67b31e..3476a9ac93 100644 --- a/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx +++ b/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx @@ -149,6 +149,7 @@ const Component: ActionComponent = (props) => { className="mb-4" disabled={!props.isCreating} fieldName={props.fieldNamePrefix + 'chainId'} + onlyDaoChainIds /> )} @@ -182,8 +183,9 @@ const Component: ActionComponent = (props) => { export const makeAuthzExecAction: ActionMaker = ({ t, - address: grantee, + address: mainAddress, chain: { chain_id: currentChainId }, + context, }) => { const useDefaults: UseDefaults = () => ({ chainId: currentChainId, @@ -209,8 +211,6 @@ export const makeAuthzExecAction: ActionMaker = ({ grantee: {}, msgs: {}, }) || - // Make sure this address is the grantee. - msg.stargate.value.grantee !== grantee || !Array.isArray(msg.stargate.value.msgs) ) { return { match: false } @@ -262,7 +262,11 @@ export const makeAuthzExecAction: ActionMaker = ({ stargate: { typeUrl: MsgExec.typeUrl, value: { - grantee, + grantee: + chainId === currentChainId || + context.type !== ActionContextType.Dao + ? mainAddress + : context.info.polytoneProxies[chainId], msgs: msgs.map((msg) => cwMsgToProtobuf(msg, address)), } as MsgExec, },