Skip to content

Commit

Permalink
Merge pull request #734 from nspcc-dev/fix/getblock-response
Browse files Browse the repository at this point in the history
[rpc/server] fix getblock verbose response
  • Loading branch information
roman-khimov committed Mar 6, 2020
2 parents 0e8ff55 + b34ac22 commit 1b7b9e7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/rpc/response/result/block.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package result

import (
"strconv"
"fmt"

"github.com/nspcc-dev/neo-go/pkg/core"
"github.com/nspcc-dev/neo-go/pkg/core/block"
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
"github.com/nspcc-dev/neo-go/pkg/io"
"github.com/nspcc-dev/neo-go/pkg/util"
)
Expand Down Expand Up @@ -41,7 +42,7 @@ type (
Time uint32 `json:"time"`
Index uint32 `json:"index"`
Nonce string `json:"nonce"`
NextConsensus util.Uint160 `json:"nextconsensus"`
NextConsensus string `json:"nextconsensus"`

Confirmations uint32 `json:"confirmations"`

Expand All @@ -61,8 +62,8 @@ func NewBlock(b *block.Block, chain core.Blockchainer) Block {
MerkleRoot: b.MerkleRoot,
Time: b.Timestamp,
Index: b.Index,
Nonce: strconv.FormatUint(b.ConsensusData, 16),
NextConsensus: b.NextConsensus,
Nonce: fmt.Sprintf("%016x", b.ConsensusData),
NextConsensus: address.Uint160ToString(b.NextConsensus),
Confirmations: chain.BlockHeight() - b.Index - 1,

Script: b.Script,
Expand Down

0 comments on commit 1b7b9e7

Please sign in to comment.