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

Fix a few Ethereum & WalletConnect related issues #91

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

xphoniex
Copy link
Contributor

@xphoniex xphoniex commented May 2, 2022

No description provided.

ens/src/lib.rs Outdated Show resolved Hide resolved
@@ -80,6 +80,7 @@ impl SignerOptions {
}
Long("walletconnect") => {
options.walletconnect = true;
std::env::set_var("RAD_SIGNER_LEGACY", "true");
Copy link
Contributor

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 😂

Copy link
Contributor Author

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.

* 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 <[email protected]>
Affects:
 * rad-gov
 * rad-ens

Signed-off-by: xphoniex <[email protected]>
.await
.map_err(SignerMiddlewareError::SignerError)
}
}
Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor Author

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.

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.

2 participants