From 27a57e1a2d3cef683081d8abc3cc231da59ee531 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 19 Nov 2019 20:23:14 +0300 Subject: [PATCH] transaction: allow system fee specification in NewInvocationTX It's not possible to create any deployment TX without it. --- pkg/core/transaction/invocation.go | 3 ++- pkg/core/transaction/transaction_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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)