forked from TrueCloudLab/neoneo-go
core: remove Block.GetTransactions, Block.GetTransactionsCount interops
Updated System.Blockchain.GetBlock interop replaced the functionality of the following interops: System.Block.GetTransactions System.Block.GetTransactionCount Neo.Block.GetTransactions Neo.Block.GetTransactionsCount
This commit is contained in:
parent
7a2d37cf7e
commit
8b7abd36c9
5 changed files with 0 additions and 63 deletions
|
@ -250,35 +250,6 @@ func headerGetTimestamp(ic *interop.Context, v *vm.VM) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// blockGetTransactionCount returns transactions count in the given block.
|
||||
func blockGetTransactionCount(ic *interop.Context, v *vm.VM) error {
|
||||
blockInterface := v.Estack().Pop().Value()
|
||||
block, ok := blockInterface.(*block.Block)
|
||||
if !ok {
|
||||
return errors.New("value is not a block")
|
||||
}
|
||||
v.Estack().PushVal(len(block.Transactions))
|
||||
return nil
|
||||
}
|
||||
|
||||
// blockGetTransactions returns transactions from the given block.
|
||||
func blockGetTransactions(ic *interop.Context, v *vm.VM) error {
|
||||
blockInterface := v.Estack().Pop().Value()
|
||||
block, ok := blockInterface.(*block.Block)
|
||||
if !ok {
|
||||
return errors.New("value is not a block")
|
||||
}
|
||||
if len(block.Transactions) > vm.MaxArraySize {
|
||||
return errors.New("too many transactions")
|
||||
}
|
||||
txes := make([]stackitem.Item, 0, len(block.Transactions))
|
||||
for _, tx := range block.Transactions {
|
||||
txes = append(txes, stackitem.NewInterop(tx))
|
||||
}
|
||||
v.Estack().PushVal(txes)
|
||||
return nil
|
||||
}
|
||||
|
||||
// engineGetScriptContainer returns transaction that contains the script being
|
||||
// run.
|
||||
func engineGetScriptContainer(ic *interop.Context, v *vm.VM) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue