You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()
}
The text was updated successfully, but these errors were encountered:
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()
}
The text was updated successfully, but these errors were encountered: