INFURA / go-ethlibs

Ethereum libraries in Go for interacting with Ethereum nodes
MIT License
162 stars 34 forks source link

Add eth.Transaction.IsProtected method #47

Closed ryanschneider closed 3 years ago

ryanschneider commented 3 years ago

This PR adds a simple eth.Transaction.IsProtected() bool method that transaction consumers can use to ensure they are only processing transactions protected by EIP-155 or later protection mechanisms (e.g. all EIP-2930 txs are inherently replay protected since the chainId is included as a discrete field).

Also added a docstring to eth.Transaction.Signature that I missed in my last PR. 😊