-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Nikos/5711/transaction with local wallet index should support to as a wallet index #5731
Nikos/5711/transaction with local wallet index should support to as a wallet index #5731
Conversation
…es" and add receiver error code as 437 This reverts commit 8e73e74.
packages/web3-eth/test/integration/web3_eth/send_transaction.test.ts
Outdated
Show resolved
Hide resolved
packages/web3-eth/test/integration/web3_eth/send_transaction.test.ts
Outdated
Show resolved
Hide resolved
packages/web3-types/src/eth_types.ts
Outdated
| export interface TransactionWithLocalWalletIndex extends Omit<TransactionBase, 'to'> { | ||
| from?: Numbers; | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| to?: Address | Numbers | null; |
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.
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)
…est.ts Co-authored-by: Wyatt Barnes <[email protected]>
…est.ts Co-authored-by: Wyatt Barnes <[email protected]>
#5748) * Init TransactionWithFromLocalWalletIndex, TransactionWithToLocalWalletIndex, TransactionWithToAndFromLocalWalletIndex types * Add null to Transaction.to * Rename TransactionWithToAndFromLocalWalletIndex to TransactionWithFromAndToLocalWalletIndex
Description
closes #5711
Checklist for 4.x:
yarnsuccessfullyyarn lintsuccessfullyyarn build:websuccessfullyyarn test:unitsuccessfullyyarn test:integrationsuccessfullycompile:contractssuccessfullyCHANGELOG.mdfile in the packages I have edited.