Skip to content
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

Nikos/5711/transaction with local wallet index should support to as a wallet index #5731

Conversation

nikoulai
Copy link
Contributor

@nikoulai nikoulai commented Jan 5, 2023

Description

closes #5711

Checklist for 4.x:

  • I have selected the correct 4.x base branch.
  • Within the description, the feature or issue is discussed in detail or an issue is linked.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added any required tests for the changes I made
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules.
  • I ran yarn successfully
  • I ran yarn lint successfully
  • I ran yarn build:web successfully
  • I ran yarn test:unit successfully
  • I ran yarn test:integration successfully
  • I ran compile:contracts successfully
  • I have tested my code.
  • I have updated the corresponding CHANGELOG.md file in the packages I have edited.

@nikoulai nikoulai added the 4.x 4.0 related label Jan 5, 2023
@nikoulai nikoulai self-assigned this Jan 5, 2023
CHANGELOG.md Show resolved Hide resolved
packages/web3-eth/src/utils/transaction_builder.ts Outdated Show resolved Hide resolved
packages/web3-eth/src/utils/transaction_builder.ts Outdated Show resolved Hide resolved
from?: Numbers;
// eslint-disable-next-line @typescript-eslint/ban-types
to?: Address | Numbers | null;
Copy link
Contributor

Choose a reason for hiding this comment

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

to being Address | null is already handled by the type TransactionBase, so it should just be listed as Numbers here. The problem is from could be the local wallet index while to is Address | null, so I see why you did this, but it doesn't work for the inverse where to is an index but from is Address | null

I'm not sure how else to this besides introducing the following types: TransactionWithFromLocalWalletIndex, TransactionWithToLocalWalletIndex, and TransactionWithFromAndToLocalWalletIndex, so definitely open to suggestions. I've opened #5748 to implement this (doesn't update the CHANGELOGs, so that will need to be done if you decided to merge it)

nikoulai and others added 5 commits January 13, 2023 11:06
#5748)

* Init TransactionWithFromLocalWalletIndex, TransactionWithToLocalWalletIndex, TransactionWithToAndFromLocalWalletIndex types

* Add null to Transaction.to

* Rename TransactionWithToAndFromLocalWalletIndex to TransactionWithFromAndToLocalWalletIndex
@spacesailor24 spacesailor24 merged commit d3f2b71 into 4.x Jan 13, 2023
@spacesailor24 spacesailor24 deleted the nikos/5711/TransactionWithLocalWalletIndex-should-support-to-as-a-wallet-index branch January 13, 2023 18:48
@spacesailor24 spacesailor24 mentioned this pull request Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants