Esempio n. 1
0
        void IInteroperable.FromStackItem(StackItem stackItem)
        {
            Array array = (Array)stackItem;

            Id            = (int)array[0].GetInteger();
            UpdateCounter = (ushort)array[1].GetInteger();
            Hash          = new UInt160(array[2].GetSpan());
            Nef           = array[3].GetSpan().AsSerializable <NefFile>();
            Manifest      = array[4].ToInteroperable <ContractManifest>();
        }
Esempio n. 2
0
 /// <summary>
 /// Computes the checksum for the specified nef file.
 /// </summary>
 /// <param name="file">The specified nef file.</param>
 /// <returns>The checksum of the nef file.</returns>
 public static uint ComputeChecksum(NefFile file)
 {
     return(BinaryPrimitives.ReadUInt32LittleEndian(Crypto.Hash256(file.ToArray().AsSpan(..^ sizeof(uint)))));
 }