diff --git a/pkg/core/transaction/invocation.go b/pkg/core/transaction/invocation.go index a0d82cb58..f303ddf16 100644 --- a/pkg/core/transaction/invocation.go +++ b/pkg/core/transaction/invocation.go @@ -17,12 +17,13 @@ type InvocationTX struct { } // NewInvocationTX returns a new invocation transaction. -func NewInvocationTX(script []byte) *Transaction { +func NewInvocationTX(script []byte, gas util.Fixed8) *Transaction { return &Transaction{ Type: InvocationType, Version: 1, Data: &InvocationTX{ Script: script, + Gas: gas, Version: 1, }, Attributes: []*Attribute{}, diff --git a/pkg/core/transaction/transaction_test.go b/pkg/core/transaction/transaction_test.go index 4d5ef35ac..45fc7bb0a 100644 --- a/pkg/core/transaction/transaction_test.go +++ b/pkg/core/transaction/transaction_test.go @@ -98,7 +98,7 @@ func TestDecodeEncodeInvocationTX(t *testing.T) { func TestNewInvocationTX(t *testing.T) { script := []byte{0x51} - tx := NewInvocationTX(script) + tx := NewInvocationTX(script, 1) txData := tx.Data.(*InvocationTX) assert.Equal(t, InvocationType, tx.Type) assert.Equal(t, tx.Version, txData.Version)