-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing data to Consensus tx list #1462
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Show missing columns in Consensus transactions list |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,73 +56,82 @@ export const ConsensusTransactions: FC<ConsensusTransactionsProps> = ({ | |
] | ||
: []), | ||
] | ||
const tableRows = transactions?.map(transaction => ({ | ||
key: `${transaction.hash}${transaction.index}`, | ||
data: [ | ||
{ | ||
content: <StatusIcon success={transaction.success} error={transaction.error} />, | ||
key: 'success', | ||
}, | ||
{ | ||
content: <TransactionLink scope={transaction} alwaysTrim hash={transaction.hash} />, | ||
key: 'hash', | ||
}, | ||
{ | ||
content: <BlockLink scope={transaction} height={transaction.block} />, | ||
key: 'round', | ||
}, | ||
{ | ||
content: <Age sinceTimestamp={transaction.timestamp} />, | ||
key: 'timestamp', | ||
}, | ||
...(verbose | ||
? [ | ||
{ | ||
content: <ConsensusTransactionMethod method={transaction.method} truncate />, | ||
key: 'method', | ||
}, | ||
{ | ||
align: TableCellAlign.Right, | ||
content: ( | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
position: 'relative', | ||
pr: 3, | ||
}} | ||
> | ||
|
||
const tableRows = transactions?.map(transaction => { | ||
const targetAddress = transaction.body.to || transaction.body.account | ||
return { | ||
key: `${transaction.hash}${transaction.index}`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it was needed in the past #1412 |
||
data: [ | ||
{ | ||
content: <StatusIcon success={transaction.success} error={transaction.error} />, | ||
key: 'success', | ||
}, | ||
{ | ||
content: <TransactionLink scope={transaction} alwaysTrim hash={transaction.hash} />, | ||
key: 'hash', | ||
}, | ||
{ | ||
content: <BlockLink scope={transaction} height={transaction.block} />, | ||
key: 'round', | ||
}, | ||
{ | ||
content: <Age sinceTimestamp={transaction.timestamp} />, | ||
key: 'timestamp', | ||
}, | ||
...(verbose | ||
? [ | ||
{ | ||
content: <ConsensusTransactionMethod method={transaction.method} truncate />, | ||
key: 'method', | ||
}, | ||
{ | ||
align: TableCellAlign.Right, | ||
content: ( | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
position: 'relative', | ||
pr: 3, | ||
}} | ||
> | ||
<AccountLink | ||
labelOnly={transaction.sender === ownAddress} | ||
scope={transaction} | ||
address={transaction.sender} | ||
alwaysTrim | ||
/> | ||
</Box> | ||
), | ||
key: 'from', | ||
}, | ||
{ | ||
content: targetAddress ? ( | ||
<AccountLink | ||
labelOnly={!!ownAddress && transaction.sender === ownAddress} | ||
labelOnly={targetAddress === ownAddress} | ||
scope={transaction} | ||
address={transaction.sender} | ||
address={targetAddress} | ||
alwaysTrim | ||
/> | ||
</Box> | ||
), | ||
key: 'from', | ||
}, | ||
{ | ||
// TODO: show recipients address when props is added to API | ||
content: <>-</>, | ||
key: 'to', | ||
}, | ||
{ | ||
align: TableCellAlign.Right, | ||
content: <RoundedBalance value={transaction.fee} ticker={transaction.ticker} />, | ||
key: 'fee_amount', | ||
}, | ||
{ | ||
align: TableCellAlign.Right, | ||
// TODO: show RoundedBalance when API returns amount prop | ||
content: <>-</>, | ||
key: 'value', | ||
}, | ||
] | ||
: []), | ||
], | ||
highlight: transaction.markAsNew, | ||
})) | ||
) : null, | ||
key: 'to', | ||
}, | ||
{ | ||
align: TableCellAlign.Right, | ||
content: <RoundedBalance value={transaction.fee} ticker={transaction.ticker} />, | ||
key: 'fee_amount', | ||
}, | ||
{ | ||
align: TableCellAlign.Right, | ||
content: <RoundedBalance value={transaction.body.amount} ticker={transaction.ticker} />, | ||
key: 'value', | ||
}, | ||
] | ||
: []), | ||
], | ||
highlight: transaction.markAsNew, | ||
} | ||
}) | ||
|
||
return ( | ||
<Table | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transactions consensus and runtime APIs are not consistent:
runtime has props
where here we use body. not sure this should be unified in Nexus. Current API might work fine with new design where we will have to render different
body
props depends on a tx type.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say it would be nice to unify, but not high priority. Let's make it work on our side, and BE can resolve it, once they find the time.