Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions packages/next-common/components/papiCallTreeView/arrayPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ export default function ArrayPanel({ node }) {
{name ? `${name}: ${type}` : type}
</span>
</div>
<IndentPanel className="gap-[8px]">
{(children || [])
.filter((child) => child !== null && child !== undefined)
.map((child, i) => (
<ValuePanel key={i} node={child} />
))}
</IndentPanel>
{(children || []).length > 0 ? (
<IndentPanel className="gap-[8px]">
{(children || [])
.filter((child) => child !== null && child !== undefined)
.map((child, i) => (
<ValuePanel key={i} node={child} />
))}
</IndentPanel>
) : (
<IndentPanel className="gap-[8px]">
<span className="text-textTertiary">Empty</span>
</IndentPanel>
)}
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
15 changes: 15 additions & 0 deletions packages/next-common/utils/callDecoder/typeName.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions packages/next-common/utils/consts/settings/hydradx.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ const hydradx = {
openSquare: {
voting: "hydration",
},
enablePapi: true,
};

export default hydradx;
Loading