2020-05-17 18:59:20 +00:00
|
|
|
/*
|
|
|
|
Package block provides getters for Neo Block structure.
|
|
|
|
*/
|
2018-08-21 10:57:48 +00:00
|
|
|
package block
|
|
|
|
|
2020-03-03 14:21:42 +00:00
|
|
|
import "github.com/nspcc-dev/neo-go/pkg/interop/transaction"
|
2018-08-21 10:57:48 +00:00
|
|
|
|
2020-05-17 18:59:20 +00:00
|
|
|
// Block represents a NEO block, it's an opaque data structure that you can get
|
|
|
|
// data from only using functions from this package. It's similar in function to
|
|
|
|
// the Block class in the Neo .net framework. To use it you need to get it via
|
|
|
|
// blockchain.GetBlock function call.
|
2018-08-21 10:57:48 +00:00
|
|
|
type Block struct{}
|
|
|
|
|
2020-05-17 18:59:20 +00:00
|
|
|
// GetTransactionCount returns the number of recorded transactions in the given
|
|
|
|
// block. It uses `Neo.Block.GetTransactionCount` syscall internally.
|
2018-08-21 10:57:48 +00:00
|
|
|
func GetTransactionCount(b Block) int {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetTransactions returns a slice of transactions recorded in the given block.
|
2020-05-17 18:59:20 +00:00
|
|
|
// It uses `Neo.Block.GetTransactions` syscall internally.
|
2018-08-21 10:57:48 +00:00
|
|
|
func GetTransactions(b Block) []transaction.Transaction {
|
|
|
|
return []transaction.Transaction{}
|
|
|
|
}
|
|
|
|
|
2020-05-17 18:59:20 +00:00
|
|
|
// GetTransaction returns transaction from the given block by its index. It
|
|
|
|
// uses `Neo.Block.GetTransaction` syscall internally.
|
|
|
|
func GetTransaction(b Block, index int) transaction.Transaction {
|
2018-08-21 10:57:48 +00:00
|
|
|
return transaction.Transaction{}
|
|
|
|
}
|