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

feat: Add better tracebacks for incorrect tx data #14

Open
Aviksaikat opened this issue Dec 31, 2024 · 0 comments
Open

feat: Add better tracebacks for incorrect tx data #14

Aviksaikat opened this issue Dec 31, 2024 · 0 comments
Assignees
Labels
good first issue Good for newcomers python Pull requests that update Python code

Comments

@Aviksaikat
Copy link
Member

Summary

# this will only give validation error
tx1 = {
  "from": wallet.address,
  "to": "0x0545640A0EcD6FB6ae94766811F30dCDA4746DFC",
  "value": 1,
  "gas": 100_000,
  "gasPrice": web3.eth.gas_price,
}

# correct way 
tx2 = {
  "from": wallet.address,
  "to": "0x0545640A0EcD6FB6ae94766811F30dCDA4746DFC",
  "value": 1,
  "gas": 100_000,
  "gasPrice": web3.eth.gas_price,
  "chainId": web3.eth.chain_id,
  "data": "0x",
}

When attempting to pass tx1 to the sign_transaction method it should trow IncorrectValues or similar error saying data and chainId is missing.

@Aviksaikat Aviksaikat added good first issue Good for newcomers python Pull requests that update Python code labels Dec 31, 2024
@Aviksaikat Aviksaikat self-assigned this Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

1 participant