neoneo-go/pkg/interop/native/ledger/block.go
Elizaveta Chichindaeva 28908aa3cf [#2442] English Check
Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
2022-05-04 19:48:27 +03:00

31 lines
1.1 KiB
Go

package ledger
import "github.com/nspcc-dev/neo-go/pkg/interop"
// Block represents a NEO block, it's a data structure where you can get
// block-related data from. It's similar to the Block class in the Neo .net
// framework. To use it, you need to get it via GetBlock function call.
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
// Nonce represents block nonce.
Nonce int
// Index represents the height of the block.
Index int
// NextConsensus represents the contract address of the next miner (160 bit BE
// value in a 20 byte slice).
NextConsensus interop.Hash160
// TransactionsLength represents the length of block's transactions array.
TransactionsLength int
}