Commit 93f84be0 authored by tom goriunov's avatar tom goriunov Committed by GitHub

Contract call response displayed with empty values (#2307)

Fixes #2306
parent f37088f0
...@@ -69,6 +69,17 @@ const abiItem: AbiFunction = { ...@@ -69,6 +69,17 @@ const abiItem: AbiFunction = {
name: 'internalProposals', name: 'internalProposals',
type: 'tuple[]', type: 'tuple[]',
}, },
// ARRAY OF TUPLES WITHOUT NAMES
{
components: [
{ type: 'address' },
{ type: 'uint256' },
],
internalType: 'struct SharingPercentage[]',
name: '_sharingPercentages',
type: 'tuple[]',
},
], ],
}; };
...@@ -115,6 +126,10 @@ const result = [ ...@@ -115,6 +126,10 @@ const result = [
}, },
}, },
], ],
[
[ '0xfD36176C63dA52E783a347DE3544B0b44C7054a6', 0 ],
[ '0xC9534cB913150aD3e98D792857689B55e2404212', 3500 ],
],
]; ];
const onSettle = () => {}; const onSettle = () => {};
......
...@@ -23,8 +23,20 @@ const ItemTuple = ({ abiParameter, data, mode, level }: Props) => { ...@@ -23,8 +23,20 @@ const ItemTuple = ({ abiParameter, data, mode, level }: Props) => {
<span> { '{' }</span> <span> { '{' }</span>
</p> </p>
{ 'components' in abiParameter && abiParameter.components.map((component, index) => { { 'components' in abiParameter && abiParameter.components.map((component, index) => {
const dataObj = typeof data === 'object' && data !== null ? data : undefined; const itemData = (() => {
const itemData = dataObj && component.name && component.name in dataObj ? dataObj[component.name as keyof typeof dataObj] : undefined; if (typeof data !== 'object' || data === null) {
return;
}
if (Array.isArray(data)) {
return data[index];
}
if (component.name && component.name in data) {
return data[component.name as keyof typeof data];
}
})();
return ( return (
<Item <Item
key={ index } key={ index }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment