Skip to content
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

Add signed data/leash/signature to eth_call data #396

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ZigaMr
Copy link
Collaborator

@ZigaMr ZigaMr commented Sep 17, 2024

This PR adds signed queries to sapphire-py wrapper. Based on Go client, it builds a data_pack dictionary containing the signature and eip712 message data.
Currently returns "execution_reverted" error when testing on sapphire-localnet.

Copy link

netlify bot commented Sep 17, 2024

Deploy Preview for oasisprotocol-sapphire-paratime ready!

Name Link
🔨 Latest commit d5e90ad
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-sapphire-paratime/deploys/66ed38e64c4ab40008539b55
😎 Deploy Preview https://deploy-preview-396--oasisprotocol-sapphire-paratime.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@CedarMist CedarMist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failing

"data": params[0].get('data'),
"leash":
{
"nonce": web3.eth.get_transaction_count(params[0].get('from')),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract block and nonce into variable, to prevent multiple RPC requests for same data.

raise RuntimeError('Could not retrieve callDataPublicKey!')
do_fetch = False

c = _encrypt_tx_params(pk, params, w3, account)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes no distinction between transactions being submitted and eth_call . This will break transactions - need two code paths, one for transactions and one for eth_call.

'leash': leash,
'signature': signed_msg['signature'],
}
params[0]['data'] = cbor2.dumps(data_pack, canonical=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data isn't encrypted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants