You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys!
I'm currently testing a Smart Contract and I have been dealing with a problem that is driving me crazy.
This test worked perfectly when getting addresses from ethers.getSigners(). However, I have created a file that provides me with he addresses (the exact ones I currently have on my running node).
I have a list of addresses (which are strings). The comments of the code express what is happening.
Here's the code:
`
`
The three addToWhitelist() work fine as they are called from the contract's owner.
contract.safeMintByWhitelisted one works fine too, as addresses[0] is the owner and i can directly call the function without .connect()
Thus, the balance of addresses[0] increases by 1 after minting the token.
The two calls with the .connect don't work, so the balance of addresses[1] and addresse[2] don't increase.
Finally, all balances should be 1 as the three addresses have minted a token. However, just addresses[0] (buyerZeroBalance) has increased.
I think there may be something wrong when calling the function after connecting to the signer, but this works perfectly fine when getting the addresses from ethers.getSigners().
Hopefully someone know what I might have overlooked.
Thank you in advance.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey guys!
I'm currently testing a Smart Contract and I have been dealing with a problem that is driving me crazy.
This test worked perfectly when getting addresses from ethers.getSigners(). However, I have created a file that provides me with he addresses (the exact ones I currently have on my running node).
I have a list of addresses (which are strings). The comments of the code express what is happening.
Here's the code:
`
`
The three addToWhitelist() work fine as they are called from the contract's owner.
contract.safeMintByWhitelisted one works fine too, as addresses[0] is the owner and i can directly call the function without .connect()
Thus, the balance of addresses[0] increases by 1 after minting the token.
The two calls with the .connect don't work, so the balance of addresses[1] and addresse[2] don't increase.
Finally, all balances should be 1 as the three addresses have minted a token. However, just addresses[0] (buyerZeroBalance) has increased.
I think there may be something wrong when calling the function after connecting to the signer, but this works perfectly fine when getting the addresses from ethers.getSigners().
Hopefully someone know what I might have overlooked.
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions