File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -526,10 +526,7 @@ func (s *EthRPCTestSuite) TestSendTransaction() {
526526 httpmock .Reset ()
527527 s .registerResponse (fmt .Sprintf (`"%s"` , result ), func (body []byte ) {
528528 s .methodEqual (body , "eth_sendTransaction" )
529- s .paramsEqual (body , `[{
530- "from": ""
531- }]` )
532-
529+ s .paramsEqual (body ,`[{}]` )
533530 })
534531
535532 txid , err = s .rpc .EthSendTransaction (t )
Original file line number Diff line number Diff line change @@ -41,12 +41,13 @@ type T struct {
4141
4242// MarshalJSON implements the json.Unmarshaler interface.
4343func (t T ) MarshalJSON () ([]byte , error ) {
44- params := map [string ]interface {}{
45- "from" : t .From ,
46- }
44+ params := map [string ]interface {}{}
4745 if t .To != "" {
4846 params ["to" ] = t .To
4947 }
48+ if t .From != "" {
49+ params ["from" ] = t .From
50+ }
5051 if t .Gas > 0 {
5152 params ["gas" ] = IntToHex (t .Gas )
5253 }
You can’t perform that action at this time.
0 commit comments