diff --git a/packages/next-common/components/papiCallTreeView/arrayPanel.js b/packages/next-common/components/papiCallTreeView/arrayPanel.js index 4f073e3853..b6c36c9337 100644 --- a/packages/next-common/components/papiCallTreeView/arrayPanel.js +++ b/packages/next-common/components/papiCallTreeView/arrayPanel.js @@ -11,13 +11,19 @@ export default function ArrayPanel({ node }) { {name ? `${name}: ${type}` : type} - - {(children || []) - .filter((child) => child !== null && child !== undefined) - .map((child, i) => ( - - ))} - + {(children || []).length > 0 ? ( + + {(children || []) + .filter((child) => child !== null && child !== undefined) + .map((child, i) => ( + + ))} + + ) : ( + + Empty + + )} ); } diff --git a/packages/next-common/components/papiCallTreeView/valuePanel.js b/packages/next-common/components/papiCallTreeView/valuePanel.js index 2e48207159..2670598ea5 100644 --- a/packages/next-common/components/papiCallTreeView/valuePanel.js +++ b/packages/next-common/components/papiCallTreeView/valuePanel.js @@ -32,7 +32,7 @@ export function safeHexToString(hex) { } // const accountTypes = ["MultiAddress", "AccountId32"]; -const hashTypes = ["H256", "[u8;32]"]; +const hashTypes = ["H256", "[u8;32]", "H160", "[u8;20]"]; function TextValue({ val }) { return ( diff --git a/packages/next-common/utils/callDecoder/typeName.mjs b/packages/next-common/utils/callDecoder/typeName.mjs index 3fcbe712c8..acdb655905 100644 --- a/packages/next-common/utils/callDecoder/typeName.mjs +++ b/packages/next-common/utils/callDecoder/typeName.mjs @@ -74,6 +74,21 @@ export function getTypeName(lookupEntry, metadata, typeId) { ) { return "H256"; } + if ( + lookupEntry.len === 20 && + lookupEntry.value.type === "primitive" && + lookupEntry.value.value === "u8" + ) { + return "H160"; + } + if ( + lookupEntry.len === 4 && + lookupEntry.value.type === "primitive" && + lookupEntry.value.value === "u64" + ) { + return "U256"; + } + const innerType = getTypeName( lookupEntry.value, metadata, diff --git a/packages/next-common/utils/consts/settings/hydradx.js b/packages/next-common/utils/consts/settings/hydradx.js index 678823c201..b6cf57a250 100644 --- a/packages/next-common/utils/consts/settings/hydradx.js +++ b/packages/next-common/utils/consts/settings/hydradx.js @@ -158,6 +158,7 @@ const hydradx = { openSquare: { voting: "hydration", }, + enablePapi: true, }; export default hydradx;