-
Notifications
You must be signed in to change notification settings - Fork 21
Fix a few Ethereum & WalletConnect related issues #91
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
ed482a0 to
5e1dd2b
Compare
common/src/ethereum.rs
Outdated
| } | ||
| Long("walletconnect") => { | ||
| options.walletconnect = true; | ||
| std::env::set_var("RAD_SIGNER_LEGACY", "true"); |
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.
Not sure this is the best way to pass a variable down 😂
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.
Correct, this is temporary, and we'll eventually omit this once we move to v2.0. Also would have to add a lot of code, every place which calls ethereum::transaction has to find out if wallet is WalletConnect. there are 6 places currently which means at least 18 more lines, and an unnecessary flag on ethereum::transaction signature.
Made a compromise here.
5e1dd2b to
bffb2ae
Compare
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
* add gas limit * remove nonce (could cause issue) * don't transform `v` as it's legacy * improve signature extraction * add error for when WalletConnect API failed to sign Signed-off-by: xphoniex <dj.2dixx@gmail.com>
Affects: * rad-gov * rad-ens Signed-off-by: xphoniex <dj.2dixx@gmail.com>
bffb2ae to
f199b3d
Compare
| .await | ||
| .map_err(SignerMiddlewareError::SignerError) | ||
| } | ||
| } |
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.
Why did we copy all of this over from ethers?
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.
I mean why do we have our own Signer type with all the same methods plus one extra and our own SignerMiddleware and SignerMiddlewareError?
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.
Ok, refactored it. Check this please.
171dad3 to
49ad2de
Compare
Signed-off-by: xphoniex <dj.2dixx@gmail.com>
49ad2de to
4f1ebeb
Compare
No description provided.