From 7bef87e2ef17c6c4768a163472acf1dd5b4e1bae Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Sun, 7 Feb 2021 18:52:44 +0300 Subject: [PATCH] cli: use base64 for state dump See neo-project/neo-modules/#499. --- cli/server/dump.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/server/dump.go b/cli/server/dump.go index ccf958087..a35f2cad4 100644 --- a/cli/server/dump.go +++ b/cli/server/dump.go @@ -1,7 +1,7 @@ package server import ( - "encoding/hex" + "encoding/base64" "encoding/json" "fmt" "io/ioutil" @@ -43,8 +43,8 @@ func batchToMap(index uint32, batch *storage.MemBatch) blockDump { ops = append(ops, storageOp{ State: op, - Key: hex.EncodeToString(key[1:]), - Value: hex.EncodeToString(batch.Put[i].Value), + Key: base64.StdEncoding.EncodeToString(key[1:]), + Value: base64.StdEncoding.EncodeToString(batch.Put[i].Value), }) } @@ -56,7 +56,7 @@ func batchToMap(index uint32, batch *storage.MemBatch) blockDump { ops = append(ops, storageOp{ State: "Deleted", - Key: hex.EncodeToString(key[1:]), + Key: base64.StdEncoding.EncodeToString(key[1:]), }) }