forked from TrueCloudLab/neoneo-go
[rpc/server] fix getblock verbose response
- Nonce should not trim leading zeros - NextConsensus should returns address (uint160 -> base58)
This commit is contained in:
parent
0e8ff558d1
commit
b34ac22434
1 changed files with 5 additions and 4 deletions
|
@ -1,11 +1,12 @@
|
||||||
package result
|
package result
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
"fmt"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neo-go/pkg/core"
|
"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/block"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
|
"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/io"
|
||||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||||
)
|
)
|
||||||
|
@ -41,7 +42,7 @@ type (
|
||||||
Time uint32 `json:"time"`
|
Time uint32 `json:"time"`
|
||||||
Index uint32 `json:"index"`
|
Index uint32 `json:"index"`
|
||||||
Nonce string `json:"nonce"`
|
Nonce string `json:"nonce"`
|
||||||
NextConsensus util.Uint160 `json:"nextconsensus"`
|
NextConsensus string `json:"nextconsensus"`
|
||||||
|
|
||||||
Confirmations uint32 `json:"confirmations"`
|
Confirmations uint32 `json:"confirmations"`
|
||||||
|
|
||||||
|
@ -61,8 +62,8 @@ func NewBlock(b *block.Block, chain core.Blockchainer) Block {
|
||||||
MerkleRoot: b.MerkleRoot,
|
MerkleRoot: b.MerkleRoot,
|
||||||
Time: b.Timestamp,
|
Time: b.Timestamp,
|
||||||
Index: b.Index,
|
Index: b.Index,
|
||||||
Nonce: strconv.FormatUint(b.ConsensusData, 16),
|
Nonce: fmt.Sprintf("%016x", b.ConsensusData),
|
||||||
NextConsensus: b.NextConsensus,
|
NextConsensus: address.Uint160ToString(b.NextConsensus),
|
||||||
Confirmations: chain.BlockHeight() - b.Index - 1,
|
Confirmations: chain.BlockHeight() - b.Index - 1,
|
||||||
|
|
||||||
Script: b.Script,
|
Script: b.Script,
|
||||||
|
|
Loading…
Reference in a new issue