rpc: remove hardcoded pushbytes64 constant

Using our new and shiny opcode package.
This commit is contained in:
Roman Khimov 2019-12-03 17:27:35 +03:00
parent 138e125646
commit 141d27795e

View file

@ -95,9 +95,6 @@ func SignTx(tx *transaction.Transaction, wif *keys.WIF) error {
// GetInvocationScript returns NEO VM script containing transaction signature. // GetInvocationScript returns NEO VM script containing transaction signature.
func GetInvocationScript(tx *transaction.Transaction, wif *keys.WIF) ([]byte, error) { func GetInvocationScript(tx *transaction.Transaction, wif *keys.WIF) ([]byte, error) {
const (
pushbytes64 = 0x40
)
var ( var (
err error err error
buf = io.NewBufBinWriter() buf = io.NewBufBinWriter()
@ -112,7 +109,7 @@ func GetInvocationScript(tx *transaction.Transaction, wif *keys.WIF) ([]byte, er
if err != nil { if err != nil {
return nil, errs.Wrap(err, "Failed ti sign transaction with private key") 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 // CreateDeploymentScript returns a script that deploys given smart contract