From 141d27795ee0f1c2eee386d194c55f8c46666d4b Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 3 Dec 2019 17:27:35 +0300 Subject: [PATCH] rpc: remove hardcoded pushbytes64 constant Using our new and shiny opcode package. --- pkg/rpc/txBuilder.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/rpc/txBuilder.go b/pkg/rpc/txBuilder.go index 308c2647e..28c31b24b 100644 --- a/pkg/rpc/txBuilder.go +++ b/pkg/rpc/txBuilder.go @@ -95,9 +95,6 @@ func SignTx(tx *transaction.Transaction, wif *keys.WIF) error { // GetInvocationScript returns NEO VM script containing transaction signature. func GetInvocationScript(tx *transaction.Transaction, wif *keys.WIF) ([]byte, error) { - const ( - pushbytes64 = 0x40 - ) var ( err error buf = io.NewBufBinWriter() @@ -112,7 +109,7 @@ func GetInvocationScript(tx *transaction.Transaction, wif *keys.WIF) ([]byte, er if err != nil { return nil, errs.Wrap(err, "Failed ti sign transaction with private key") } - return append([]byte{pushbytes64}, signature...), nil + return append([]byte{byte(opcode.PUSHBYTES64)}, signature...), nil } // CreateDeploymentScript returns a script that deploys given smart contract