Skip to content

Commit

Permalink
show root invocation in details instead of stacked auth entry invocat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
aristidesstaffieri committed Feb 14, 2024
1 parent 1971d2f commit caba36b
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ export const KeyValueInvokeHostFn = ({
op: Operation.InvokeHostFunction;
}) => {
const { t } = useTranslation();
const authEntries = op.auth || [];
const hostfn = op.func;

function renderDetails() {
Expand Down Expand Up @@ -585,15 +584,28 @@ export const KeyValueInvokeHostFn = ({
}

case xdr.HostFunctionType.hostFunctionTypeInvokeContract(): {
const invocation = hostfn.invokeContract();
const contractId = StrKey.encodeContract(
invocation.contractAddress().contractId(),
);
const fnName = invocation.functionName().toString();
const args = invocation.args();

return (
<>
<KeyValueList
operationKey={t("Invocation Type")}
operationValue="Invoke Contract"
/>
{authEntries.map((entry) => (
<KeyValueAuthEntry entry={entry} />
))}
<KeyValueList
operationKey={t("Contract ID")}
operationValue={truncateString(contractId)}
/>
<KeyValueList
operationKey={t("Function Name")}
operationValue={fnName}
/>
<KeyValueInvokeHostFnArgs args={args} />
</>
);
}
Expand Down

0 comments on commit caba36b

Please sign in to comment.