diff --git a/contract/contract.go b/contract/contract.go index c62f0ebf..2a00725d 100644 --- a/contract/contract.go +++ b/contract/contract.go @@ -88,7 +88,7 @@ func (j *jsonrpcTransaction) Build() error { if j.opts.GasLimit == 0 { msg := ðgo.CallMsg{ From: from, - To: nil, + To: nil, //&j.to, Data: j.input, Value: j.opts.Value, GasPrice: j.opts.GasPrice, @@ -100,6 +100,7 @@ func (j *jsonrpcTransaction) Build() error { if err != nil { return err } + // j.opts.GasLimit += 50000 } // calculate the nonce if j.opts.Nonce == 0 { diff --git a/contract/contract_test.go b/contract/contract_test.go index 492d55fe..d79d28b7 100644 --- a/contract/contract_test.go +++ b/contract/contract_test.go @@ -125,11 +125,11 @@ func TestContract_Deploy(t *testing.T) { i := NewContract(receipt.ContractAddress, abi, WithJsonRPC(p.Eth())) resp, err := i.Call("val_0", ethgo.Latest) assert.NoError(t, err) - assert.Equal(t, resp["0"], ethgo.Address{0x1}) + assert.Equal(t, ethgo.Address{0x1}, resp["0"]) resp, err = i.Call("val_1", ethgo.Latest) assert.NoError(t, err) - assert.Equal(t, resp["0"], big.NewInt(1000)) + assert.Equal(t, big.NewInt(1000), resp["0"]) } func TestContract_Transaction(t *testing.T) { diff --git a/go.mod b/go.mod index 40a2289c..d0f8a588 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( github.com/sirupsen/logrus v1.4.2 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 // indirect - golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 // indirect + golang.org/x/sys v0.0.0-20220907062415-87db552b00fd // indirect google.golang.org/appengine v1.6.5 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/yaml.v2 v2.2.2 // indirect diff --git a/go.sum b/go.sum index 91dd4812..b06b3dde 100644 --- a/go.sum +++ b/go.sum @@ -138,6 +138,8 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220907062415-87db552b00fd h1:AZeIEzg+8RCELJYq8w+ODLVxFgLMMigSwO/ffKPEd9U= +golang.org/x/sys v0.0.0-20220907062415-87db552b00fd/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=