-
Notifications
You must be signed in to change notification settings - Fork 29
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
examples/onchain-signer/test: Add support for Sapphire Testnet/Mainnet #208
Conversation
e36ac06
to
be85b2c
Compare
I made some minor changes to the Gasless contract to simplify it, the tests pass locally and on testnet. There are 2 problems:
To add back in the |
4c8f024
to
f5c3a72
Compare
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 know this was already merged, just leaving some comments for future.
// Proxy for gasless transaction. | ||
contract Gasless { | ||
EthereumKeypair private kp; | ||
|
||
function setKeypair(EthereumKeypair memory keypair) external payable { | ||
constructor (EthereumKeypair memory keypair) payable { |
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.
Contract create transactions are usually unencrypted for verification, so that's why I decided to have the setKeypair
setter.
nonce: ethers.provider.getTransactionCount(wallet1.address), | ||
}), | ||
).not.to.be.reverted; | ||
// NOTE can be done by the contract with EthereumUtils.generateKeypair() |
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.
// NOTE: Can be done by the contract with EthereumUtils.generateKeypair().
const tx = await gasless.makeProxyTx(commentBox.address, innercall); | ||
|
||
const plainResp = await gasless.provider.sendTransaction(tx); | ||
const receipt = await ethers.provider.waitForTransaction(plainResp.hash); | ||
// TODO: https://github.com/oasisprotocol/sapphire-paratime/issues/179 |
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 relevant anymore.
@@ -9,22 +9,15 @@ struct EthereumKeypair { | |||
uint64 nonce; | |||
} | |||
|
|||
struct EthTx { |
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.
Should we rename EIP155Signer.EthTx
to EIP155Signer.Tx
or EIP155Signer.Transaction
?
This PR makes examples/onchain-signer tests actually pass on sapphire-testnet.
Merge after #175 since we use the wrapped provider for gasless tx.