Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Add name and address to modules #3125

Merged
merged 2 commits into from
Dec 14, 2021
Merged

Add name and address to modules #3125

merged 2 commits into from
Dec 14, 2021

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Dec 7, 2021

What it solves

Resolves #2990

How this PR fixes it

Interactions with modules in the transaction list now show their name and address in the transaction details. The name is shown in a priority of: address book name, name returned from backend, "Unknown module".

How to test it

  1. Create a transaction that interfacts with module.
  2. If the module is from an 'unknown' address, it will be shown as such.
  3. Add the module address to the address book and the transactions will reflect this.
  4. If the module is a 'known' address, it will show the name returned from backend. An example of this is can be found here (pictured below):

Screenshots

image

@github-actions
Copy link

github-actions bot commented Dec 7, 2021

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Dec 7, 2021

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@github-actions
Copy link

github-actions bot commented Dec 7, 2021

Deployment links

🟠 Safe Rinkeby Safe Mainnet 🟣 Safe Polygon 🟡 Safe BSC Safe Arbitrum 🟢 Safe xDai

@coveralls
Copy link

coveralls commented Dec 7, 2021

Pull Request Test Coverage Report for Build 1550072916

  • 7 of 35 (20.0%) changed or added relevant lines in 9 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 32.197%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/routes/safe/components/Settings/SpendingLimit/InfoDisplay/AddressInfo.tsx 1 2 50.0%
src/routes/safe/components/Transactions/TxList/AddressInfo.tsx 0 1 0.0%
src/routes/safe/components/Transactions/TxList/hooks/useTransactionType.ts 0 1 0.0%
src/routes/safe/components/Transactions/TxList/TxData.tsx 0 2 0.0%
src/routes/safe/components/Transactions/TxList/TxInfoCreation.tsx 0 3 0.0%
src/routes/safe/components/Transactions/TxList/TxCollapsed.tsx 1 5 20.0%
src/routes/safe/components/Transactions/TxList/utils.ts 1 5 20.0%
src/routes/safe/components/Transactions/TxList/hooks/useKnownAddress.ts 2 7 28.57%
src/routes/safe/components/Transactions/TxList/SpendingLimitDetails.tsx 2 9 22.22%
Files with Coverage Reduction New Missed Lines %
src/routes/safe/components/Transactions/TxList/SpendingLimitDetails.tsx 1 15.69%
Totals Coverage Status
Change from base Build 1548873437: -0.2%
Covered Lines: 3079
Relevant Lines: 8468

💛 - Coveralls

@github-actions
Copy link

github-actions bot commented Dec 7, 2021

E2E Tests Failed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1550109610

Failed tests:

  • ❌ Add an existing safe Add an existing safe
  • ❌ Address book Address book
  • ❌ Safe Apps List Safe Apps List
  • ❌ Read-only transaction creation and review Create and review a Send Funds transaction

}

// FixMe: this way won't scale well
if (isDeleteAllowance(txData.dataDecoded.method)) {
return <DeleteSpendingLimitDetails data={txData.dataDecoded} />
console.log(txInfo)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console.log

Comment on lines +17 to +19
const creator = useKnownAddress(txInfo.creator)
const factory = useKnownAddress(txInfo.factory)
const implementation = useKnownAddress(txInfo.implementation)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@francovenica
Copy link
Contributor

Looks good with the modules I have to test. I don't have an "unknown module" address to test with.
Tested with spending limit and a module we have in our test cases that has a name in the backend.
I gave a name in the AB to this last module, so its name from the backend was replaced by the one in the AB.

Safe:
https://pr3125--safereact.review-safe.gnosisdev.com/app/rin:0xEbc3b7c05019773e951a5DDaA54D4e51FEC6Da53/transactions/history

Snapshots:
image
image
image

@iamacook iamacook merged commit 07c01c4 into dev Dec 14, 2021
@iamacook iamacook deleted the show-module-tx-details branch December 14, 2021 09:17
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show Module Tx details in Transaction List
5 participants