Skip to content

feat: Add better tracebacks for incorrect tx data #14

@Aviksaikat

Description

@Aviksaikat

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.

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomerspythonPull requests that update Python code

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions