2021-02-08 08:10:25 +00:00
|
|
|
package ledger
|
|
|
|
|
|
|
|
import "github.com/nspcc-dev/neo-go/pkg/interop"
|
|
|
|
|
2022-04-20 18:30:09 +00:00
|
|
|
// Block represents a NEO block, it's a data structure where you can get
|
2021-02-08 08:10:25 +00:00
|
|
|
// block-related data from. It's similar to the Block class in the Neo .net
|
2022-04-20 18:30:09 +00:00
|
|
|
// framework. To use it, you need to get it via GetBlock function call.
|
2021-02-08 08:10:25 +00:00
|
|
|
type Block struct {
|
|
|
|
// Hash represents the hash (256 bit BE value in a 32 byte slice) of the
|
|
|
|
// given block.
|
|
|
|
Hash interop.Hash256
|
|
|
|
// Version of the block.
|
|
|
|
Version int
|
|
|
|
// PrevHash represents the hash (256 bit BE value in a 32 byte slice) of the
|
|
|
|
// previous block.
|
|
|
|
PrevHash interop.Hash256
|
|
|
|
// MerkleRoot represents the root hash (256 bit BE value in a 32 byte slice)
|
|
|
|
// of a transaction list.
|
|
|
|
MerkleRoot interop.Hash256
|
|
|
|
// Timestamp represents millisecond-precision block timestamp.
|
|
|
|
Timestamp int
|
2021-07-14 08:32:54 +00:00
|
|
|
// Nonce represents block nonce.
|
|
|
|
Nonce int
|
2021-02-08 08:10:25 +00:00
|
|
|
// Index represents the height of the block.
|
|
|
|
Index int
|
2022-04-20 18:30:09 +00:00
|
|
|
// NextConsensus represents the contract address of the next miner (160 bit BE
|
2021-02-08 08:10:25 +00:00
|
|
|
// value in a 20 byte slice).
|
|
|
|
NextConsensus interop.Hash160
|
|
|
|
// TransactionsLength represents the length of block's transactions array.
|
|
|
|
TransactionsLength int
|
|
|
|
}
|