github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/rpcclient/gas/gas_test.go (about) 1 package gas 2 3 import ( 4 "testing" 5 6 "github.com/nspcc-dev/neo-go/pkg/core/transaction" 7 "github.com/nspcc-dev/neo-go/pkg/neorpc/result" 8 "github.com/nspcc-dev/neo-go/pkg/util" 9 "github.com/stretchr/testify/require" 10 ) 11 12 type testAct struct { 13 err error 14 res *result.Invoke 15 tx *transaction.Transaction 16 txh util.Uint256 17 vub uint32 18 } 19 20 func (t *testAct) Call(contract util.Uint160, operation string, params ...any) (*result.Invoke, error) { 21 return t.res, t.err 22 } 23 func (t *testAct) MakeRun(script []byte) (*transaction.Transaction, error) { 24 return t.tx, t.err 25 } 26 func (t *testAct) MakeUnsignedRun(script []byte, attrs []transaction.Attribute) (*transaction.Transaction, error) { 27 return t.tx, t.err 28 } 29 func (t *testAct) SendRun(script []byte) (util.Uint256, uint32, error) { 30 return t.txh, t.vub, t.err 31 } 32 33 func TestNew(t *testing.T) { 34 ta := &testAct{} 35 gr := NewReader(ta) 36 require.NotNil(t, gr) 37 38 g := New(ta) 39 require.NotNil(t, g) 40 }