Chained methods on our types can cause crashes if a method or a field in a struct is nil
Implementation
Should we put guards on these? Do we know these fields/method returns will always be non-nil?
Example:
// Type returns the transaction type.
func (tx *Transaction) Type() uint8 {
return tx.inner.txType()
}
// ChainId returns the chain ID of the transaction. The return value will always be
// non-nil.
func (tx Transaction) ChainId() big.Int {
return tx.inner.chainID()
}
Rationale
Chained methods on our types can cause crashes if a method or a field in a struct is nil
Implementation
Should we put guards on these? Do we know these fields/method returns will always be non-nil?
Example: // Type returns the transaction type. func (tx *Transaction) Type() uint8 { return tx.inner.txType() }
// ChainId returns the chain ID of the transaction. The return value will always be // non-nil. func (tx Transaction) ChainId() big.Int { return tx.inner.chainID() }