Skip to content

Commit

Permalink
Merge pull request #428 from dan13ram/decode-multisend-txs
Browse files Browse the repository at this point in the history
deep decode proposal actions
  • Loading branch information
skuhlmann authored Oct 2, 2023
2 parents 826eb58 + 406e2e1 commit a47d30d
Show file tree
Hide file tree
Showing 6 changed files with 459 additions and 76 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { useState } from 'react';
import { isValidNetwork } from '@daohaus/keychain-utils';
import { MolochV3Proposal } from '@daohaus/moloch-v3-data';
import { DecodedMultiTX, isActionError } from '@daohaus/tx-builder';
import {
DeepDecodedMultiTX as DecodedMultiTX,
isActionError,
} from '@daohaus/tx-builder';
import {
AddressDisplay,
Bold,
Expand Down Expand Up @@ -73,7 +76,7 @@ export const ProposalActionData = ({
<MainContainer>
<DisplayContainer>
<TitleContainer>
<ParMd>Transaction Call Data</ParMd>
<ParMd>Decoded Transaction Data</ParMd>

{!actionData && (
<LoadingContainer>
Expand Down Expand Up @@ -166,6 +169,16 @@ export const ProposalActionData = ({
</div>
);
})}
{action.decodedActions?.length ? (
<ProposalActionData
daoChain={daoChain}
daoId={daoId}
proposal={proposal}
proposalActionConfig={proposalActionConfig}
actionData={action.decodedActions}
decodeError={decodeError}
/>
) : null}
</div>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
TXLego,
} from '@daohaus/utils';
import {
DecodedMultiTX,
decodeProposalActions,
DeepDecodedMultiTX as DecodedMultiTX,
deepDecodeProposalActions as decodeProposalActions,
isActionError,
} from '@daohaus/tx-builder';
import { ValidNetwork, isValidNetwork } from '@daohaus/keychain-utils';
Expand Down Expand Up @@ -61,12 +61,11 @@ export const ProposalDetailsContainer = ({
const fetchPropActions = async (
chainId: ValidNetwork,
actionData: string,
actionMeta?: MulticallAction[]
_actionMeta?: MulticallAction[]
) => {
const proposalActions = await decodeProposalActions({
chainId,
actionData,
actionsMeta: actionMeta,
});
if (shouldUpdate) {
setActionData(proposalActions);
Expand Down
Loading

0 comments on commit a47d30d

Please sign in to comment.