From 360bb220b0b6da3800c3eebf314bcc2622c229fc Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 11 Oct 2021 16:44:22 +0300 Subject: [PATCH] rpc: remove unnecessary base64 encoding It's default encoding for []byte. --- pkg/rpc/client/rpc.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/rpc/client/rpc.go b/pkg/rpc/client/rpc.go index b3cba29dc..aca66aba6 100644 --- a/pkg/rpc/client/rpc.go +++ b/pkg/rpc/client/rpc.go @@ -1,7 +1,6 @@ package client import ( - "encoding/base64" "errors" "fmt" @@ -420,12 +419,12 @@ func (c *Client) GetStateHeight() (*result.StateHeight, error) { // GetStorageByID returns the stored value, according to the contract ID and the stored key. func (c *Client) GetStorageByID(id int32, key []byte) ([]byte, error) { - return c.getStorage(request.NewRawParams(id, base64.StdEncoding.EncodeToString(key))) + return c.getStorage(request.NewRawParams(id, key)) } // GetStorageByHash returns the stored value, according to the contract script hash and the stored key. func (c *Client) GetStorageByHash(hash util.Uint160, key []byte) ([]byte, error) { - return c.getStorage(request.NewRawParams(hash.StringLE(), base64.StdEncoding.EncodeToString(key))) + return c.getStorage(request.NewRawParams(hash.StringLE(), key)) } func (c *Client) getStorage(params request.RawParams) ([]byte, error) {