コード例 #1
0
ファイル: Keccak.cs プロジェクト: huyen-pk/nethermind
        private static KeccakStructRef InternalCompute(Span <byte> input)
        {
            var result = new KeccakStructRef();

            KeccakHash.ComputeHashBytesToSpan(input, result.Bytes);
            return(result);
        }
コード例 #2
0
ファイル: OrExpression.cs プロジェクト: huyen-pk/nethermind
        public override bool Accepts(ref KeccakStructRef topic)
        {
            for (int i = 0; i < _subexpressions.Length; i++)
            {
                if (_subexpressions[i].Accepts(ref topic))
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #3
0
ファイル: Keccak.cs プロジェクト: huyen-pk/nethermind
        public static KeccakStructRef Compute(string input)
        {
            if (string.IsNullOrWhiteSpace(input))
            {
                return(new KeccakStructRef(Keccak.OfAnEmptyString.Bytes));
            }

            var result = new KeccakStructRef();

            KeccakHash.ComputeHashBytesToSpan(System.Text.Encoding.UTF8.GetBytes(input), result.Bytes);
            return(result);
        }
コード例 #4
0
ファイル: Keccak.cs プロジェクト: huyen-pk/nethermind
        public static KeccakStructRef Compute(Span <byte> input)
        {
            if (input.Length == 0)
            {
                return(new KeccakStructRef(Keccak.OfAnEmptyString.Bytes));
            }

            var result = new KeccakStructRef();

            KeccakHash.ComputeHashBytesToSpan(input, result.Bytes);
            return(result);
        }
コード例 #5
0
 public bool TryGetNext(out KeccakStructRef current)
 {
     if (_decoderContext.Position < _length)
     {
         _decoderContext.DecodeKeccakStructRef(out current);
         Index++;
         return(true);
     }
     else
     {
         current = new KeccakStructRef(Keccak.Zero.Bytes);
         return(false);
     }
 }
コード例 #6
0
 public TxReceiptStructRef(TxReceipt receipt)
 {
     StatusCode           = receipt.StatusCode;
     BlockNumber          = receipt.BlockNumber;
     BlockHash            = (receipt.BlockHash ?? Keccak.Zero).ToStructRef();
     TxHash               = (receipt.TxHash ?? Keccak.Zero).ToStructRef();
     Index                = receipt.Index;
     GasUsed              = receipt.GasUsed;
     GasUsedTotal         = receipt.GasUsedTotal;
     Sender               = (receipt.Sender ?? Address.Zero).ToStructRef();
     ContractAddress      = (receipt.ContractAddress ?? Address.Zero).ToStructRef();
     Recipient            = (receipt.Recipient ?? Address.Zero).ToStructRef();
     ReturnValue          = receipt.ReturnValue;
     PostTransactionState = (receipt.PostTransactionState ?? Keccak.Zero).ToStructRef();
     Bloom                = (receipt.Bloom ?? Core.Bloom.Empty).ToStructRef();
     Logs    = receipt.Logs;
     LogsRlp = Span <byte> .Empty;
     Error   = receipt.Error;
 }
コード例 #7
0
 public AddressStructRef(KeccakStructRef keccak) : this(keccak.Bytes.Slice(12, ByteLength))
 {
 }
コード例 #8
0
 public override bool Accepts(ref KeccakStructRef topic) => true;
コード例 #9
0
ファイル: Keccak.cs プロジェクト: huyen-pk/nethermind
 public bool Equals(KeccakStructRef other) => Core.Extensions.Bytes.AreEqual(other.Bytes, Bytes);
コード例 #10
0
 public abstract bool Accepts(ref KeccakStructRef topic);