diff --git a/packages/ui/.papi/metadata/acala.scale b/packages/ui/.papi/metadata/acala.scale index f2ae0465..68d39f14 100644 Binary files a/packages/ui/.papi/metadata/acala.scale and b/packages/ui/.papi/metadata/acala.scale differ diff --git a/packages/ui/.papi/metadata/bifrostDot.scale b/packages/ui/.papi/metadata/bifrostDot.scale index fbd5731c..9a6e81f0 100644 Binary files a/packages/ui/.papi/metadata/bifrostDot.scale and b/packages/ui/.papi/metadata/bifrostDot.scale differ diff --git a/packages/ui/.papi/metadata/dot.scale b/packages/ui/.papi/metadata/dot.scale index 9ddad64d..6d1a3704 100644 Binary files a/packages/ui/.papi/metadata/dot.scale and b/packages/ui/.papi/metadata/dot.scale differ diff --git a/packages/ui/.papi/metadata/dotAssetHub.scale b/packages/ui/.papi/metadata/dotAssetHub.scale index ff4478db..b48010a4 100644 Binary files a/packages/ui/.papi/metadata/dotAssetHub.scale and b/packages/ui/.papi/metadata/dotAssetHub.scale differ diff --git a/packages/ui/.papi/metadata/dotPpl.scale b/packages/ui/.papi/metadata/dotPpl.scale index 7dd1ad11..7f58fb01 100644 Binary files a/packages/ui/.papi/metadata/dotPpl.scale and b/packages/ui/.papi/metadata/dotPpl.scale differ diff --git a/packages/ui/.papi/metadata/hydration.scale b/packages/ui/.papi/metadata/hydration.scale index 65ae789b..85126702 100644 Binary files a/packages/ui/.papi/metadata/hydration.scale and b/packages/ui/.papi/metadata/hydration.scale differ diff --git a/packages/ui/.papi/metadata/ksm.scale b/packages/ui/.papi/metadata/ksm.scale index 783951f3..294de968 100644 Binary files a/packages/ui/.papi/metadata/ksm.scale and b/packages/ui/.papi/metadata/ksm.scale differ diff --git a/packages/ui/.papi/metadata/ksmAssetHub.scale b/packages/ui/.papi/metadata/ksmAssetHub.scale index 2a2f2fa7..e6037129 100644 Binary files a/packages/ui/.papi/metadata/ksmAssetHub.scale and b/packages/ui/.papi/metadata/ksmAssetHub.scale differ diff --git a/packages/ui/.papi/metadata/ksmPpl.scale b/packages/ui/.papi/metadata/ksmPpl.scale index 15d8dad0..183f6b5d 100644 Binary files a/packages/ui/.papi/metadata/ksmPpl.scale and b/packages/ui/.papi/metadata/ksmPpl.scale differ diff --git a/packages/ui/.papi/metadata/pasPpl.scale b/packages/ui/.papi/metadata/pasPpl.scale index 0a1f4eaa..be6fc6cd 100644 Binary files a/packages/ui/.papi/metadata/pasPpl.scale and b/packages/ui/.papi/metadata/pasPpl.scale differ diff --git a/packages/ui/.papi/metadata/paseo.scale b/packages/ui/.papi/metadata/paseo.scale index 353b1f7a..a52b204e 100644 Binary files a/packages/ui/.papi/metadata/paseo.scale and b/packages/ui/.papi/metadata/paseo.scale differ diff --git a/packages/ui/cypress/support/page-objects/multisigPage.ts b/packages/ui/cypress/support/page-objects/multisigPage.ts index f5407198..61997b79 100644 --- a/packages/ui/cypress/support/page-objects/multisigPage.ts +++ b/packages/ui/cypress/support/page-objects/multisigPage.ts @@ -23,6 +23,7 @@ export const multisigPage = { transactionList: () => cy.get('[data-cy=container-transaction-list]', { timeout: 20000 }), pendingTransactionItem: (timeout = 4000) => cy.get('[data-cy=container-pending-tx-item]', { timeout }), + dateLabel: () => cy.get('[data-cy=label-date]'), pendingTransactionCallName: () => cy.get('[data-cy=label-call-name]'), unknownCallIcon: () => cy.get('[data-cy=icon-unknown-call]'), unknownCallAlert: () => cy.get('[data-cy=alert-no-call-data]') diff --git a/packages/ui/cypress/tests/hydration-extrinsic-display.cy.ts b/packages/ui/cypress/tests/hydration-extrinsic-display.cy.ts index 5de44264..79afd5b1 100644 --- a/packages/ui/cypress/tests/hydration-extrinsic-display.cy.ts +++ b/packages/ui/cypress/tests/hydration-extrinsic-display.cy.ts @@ -27,6 +27,7 @@ describe('Verify extrinsics display', () => { .should('be.visible') .within(() => { multisigPage.pendingTransactionItem().should('have.length', 1) + multisigPage.dateLabel().should('have.length', 1).contains('November 5, 2024') multisigPage.pendingTransactionItem().within(() => { multisigPage.pendingTransactionCallName().should('contain.text', 'Router.sell') multisigPage.unknownCallIcon().should('not.exist') diff --git a/packages/ui/cypress/tests/unknown-transaction.cy.ts b/packages/ui/cypress/tests/unknown-transaction.cy.ts index a9a01d1b..42482e59 100644 --- a/packages/ui/cypress/tests/unknown-transaction.cy.ts +++ b/packages/ui/cypress/tests/unknown-transaction.cy.ts @@ -22,6 +22,8 @@ describe('Unknown Transaction', () => { .should('be.visible') .within(() => { multisigPage.pendingTransactionItem().should('have.length', 2) + multisigPage.dateLabel().should('have.length', 1) + multisigPage.dateLabel().eq(0).contains('September 12, 2024') multisigPage .pendingTransactionItem() .eq(1) diff --git a/packages/ui/src/components/CallInfo.tsx b/packages/ui/src/components/CallInfo.tsx index fcf32ee5..1dafce29 100644 --- a/packages/ui/src/components/CallInfo.tsx +++ b/packages/ui/src/components/CallInfo.tsx @@ -58,8 +58,8 @@ const isBatchedCall = (type: string, value: string) => { return ['Utility.batch', 'Utility.batch_all', 'Utility.force_batch'].includes(`${type}.${value}`) } -const formatBalance = (amount: bigint, label: string, chainInfo: ChainInfoHuman) => ( -
  • +const formatBalance = (amount: bigint, label: string, chainInfo: ChainInfoHuman, id: string) => ( +
  • {label}:{' '} {formatBigIntBalance(amount, chainInfo?.tokenDecimals, { tokenSymbol: chainInfo?.tokenSymbol @@ -67,32 +67,32 @@ const formatBalance = (amount: bigint, label: string, chainInfo: ChainInfoHuman)
  • ) -const eachFieldRendered = (value: Record, chainInfo: ChainInfoHuman) => { +const eachFieldRendered = (value: Record, chainInfo: ChainInfoHuman, id: string) => { // for transfer, nomination, staking, bounties const bigIntKey = ['value', 'fee', 'max_additional'].find((key) => typeof value[key] === 'bigint') if (bigIntKey) { - return formatBalance(value[bigIntKey], bigIntKey, chainInfo) + return formatBalance(value[bigIntKey], bigIntKey, chainInfo, id) } // for Staking.nominate if (Array.isArray(value.targets) && value.targets.length > 0) { return ( -
  • +
  • targets:{' '}
      - {value.targets.map((target: any) => { + {value.targets.map((target: any, index) => { const address = target.type === 'Id' ? target.value : null if (address) { return ( -
    • +
    • ) } - return
    • {JSONprint(target)}
    • + return
    • {JSONprint(target)}
    • })}
  • @@ -130,7 +130,7 @@ const eachFieldRendered = (value: Record, chainInfo: ChainInfoHuman ) } - return
  • {JSONprint(value)}
  • + return
  • {JSONprint(value)}
  • } const preparedCall = ( @@ -163,8 +163,8 @@ const preparedCall = ( )}
      - {Object.entries(lowerLevelCall).map(([key, value]) => - eachFieldRendered({ [key]: value }, chainInfo) + {Object.entries(lowerLevelCall).map(([key, value], index) => + eachFieldRendered({ [key]: value }, chainInfo, `${decodedCall.type}-${index}`) )}
    diff --git a/packages/ui/src/components/Transactions/TransactionList.tsx b/packages/ui/src/components/Transactions/TransactionList.tsx index b9c639f6..91dc1adf 100644 --- a/packages/ui/src/components/Transactions/TransactionList.tsx +++ b/packages/ui/src/components/Transactions/TransactionList.tsx @@ -53,7 +53,7 @@ const TransactionList = ({ className }: Props) => { Object.entries(txWithCallDataByDate).map(([date, aggregatedData]) => { return ( - {date} + {date} {aggregatedData.map((agg, index) => { const { callData, info, from } = agg const { threshold, signatories } = diff --git a/packages/ui/src/hooks/usePendingTx.tsx b/packages/ui/src/hooks/usePendingTx.tsx index 4b6b45e3..72d48fb8 100644 --- a/packages/ui/src/hooks/usePendingTx.tsx +++ b/packages/ui/src/hooks/usePendingTx.tsx @@ -56,7 +56,6 @@ const getMultisigInfo = async ( api: ApiType ): Promise[]> => { const compatibilityToken = await api.compatibilityToken - const result: any[] = [] // console.log('----for call', JSONprint(call)); @@ -99,7 +98,6 @@ const getMultisigInfo = async ( } getCallResults(call) - // console.log('result', JSONprint(result)) return result } @@ -143,9 +141,7 @@ const getCallDataFromChainPromise = ( // get the timestamp which is an unsigned extrinsic set by the validator in each block // the information for each of the contained extrinsics allDecodedTxs.some(({ decodedCall: { type, value } }) => { - // check for timestamp.set - if (type === 'Timestamp' && value.type === 'Set') { - // extract the Option as Moment + if (type === 'Timestamp' && value.type === 'set') { const moment = value.value.now as string // convert to date (unix ms since epoch in Moment - exactly as per the Rust code) @@ -157,10 +153,6 @@ const getCallDataFromChainPromise = ( }) const ext = allDecodedTxs[pendingTx.info.when.index] - - // const decoded = parseGenericCall(ext.method as GenericCall, ext.registry) - // console.log('pendingTxData', pendingTxData) - // console.log('decoded', decoded) const multisigTxs = (await getMultisigInfo(ext.decodedCall, api)) || [] const multisigTxInfo = multisigTxs.find((info) => {