From 4bd4635e497a232a0bf3577a4037afe8abad6f82 Mon Sep 17 00:00:00 2001 From: fyrchik Date: Wed, 27 Jun 2018 08:48:39 +0300 Subject: [PATCH] add rpc.GetRawTransaction() method (#87) --- VERSION | 2 +- pkg/rpc/rpc.go | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a8b3d5c20..23453d568 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.44.4 +0.44.5 diff --git a/pkg/rpc/rpc.go b/pkg/rpc/rpc.go index 7b6b37953..a4d7f32e2 100644 --- a/pkg/rpc/rpc.go +++ b/pkg/rpc/rpc.go @@ -57,6 +57,18 @@ func (c *Client) InvokeFunction(script, operation string, params []smartcontract return resp, nil } +// GetRawTransaction queries a transaction by hash. +func (c *Client) GetRawTransaction(hash string, verbose bool) (*response, error) { + var ( + params = newParams(hash, verbose) + resp = &response{} + ) + if err := c.performRequest("getrawtransaction", params, resp); err != nil { + return nil, err + } + return resp, nil +} + // SendRawTransaction broadcasts a transaction over the NEO network. // The given hex string needs to be signed with a keypair. // When the result of the response object is true, the TX has successfully