Пример #1
0
        public StackItem ToStackItem()
        {
            return(new VM.Types.Array
                   (
                       new StackItem[]
            {
                // Computed properties
                new ByteArray(Hash.ToArray()),

                // BlockBase properties
                new Integer(Version),
                new ByteArray(PrevHash.ToArray()),
                new ByteArray(MerkleRoot.ToArray()),
                new Integer(Timestamp),
                new Integer(Index),
                new ByteArray(NextConsensus.ToArray()),
                // Witness

                // Block properties
                // Count
                // ConsensusData
                new Integer(Transactions.Length)
            }
                   ));
        }
Пример #2
0
        StackItem IInteroperable.ToStackItem(ReferenceCounter referenceCounter)
        {
            return(new VM.Types.Array(referenceCounter, new StackItem[]
            {
                // Computed properties
                Hash.ToArray(),

                // BlockBase properties
                Version,
                PrevHash.ToArray(),
                MerkleRoot.ToArray(),
                Timestamp,
                Index,
                NextConsensus.ToArray(),

                // Block properties
                Hashes.Length - 1
            }));
        }
Пример #3
0
        public StackItem ToStackItem(ReferenceCounter referenceCounter)
        {
            return(new Array(referenceCounter, new StackItem[]
            {
                // Computed properties
                Hash.ToArray(),

                // BlockBase properties
                Version,
                PrevHash.ToArray(),
                MerkleRoot.ToArray(),
                Timestamp,
                Index,
                NextConsensus.ToArray(),

                // Block properties
                Transactions.Length
            }));
        }