MarshalJSON encodes the web3 RPC transaction format.
()
| 141 | |
| 142 | // MarshalJSON encodes the web3 RPC transaction format. |
| 143 | func (tx *Transaction) MarshalJSON() ([]byte, error) { |
| 144 | hash := tx.Hash() |
| 145 | data := tx.data |
| 146 | data.Hash = &hash |
| 147 | return data.MarshalJSON() |
| 148 | } |
| 149 | |
| 150 | // UnmarshalJSON decodes the web3 RPC transaction format. |
| 151 | func (tx *Transaction) UnmarshalJSON(input []byte) error { |