private static KeccakStructRef InternalCompute(Span <byte> input) { var result = new KeccakStructRef(); KeccakHash.ComputeHashBytesToSpan(input, result.Bytes); return(result); }
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); }
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); }
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); }
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); } }
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; }
public AddressStructRef(KeccakStructRef keccak) : this(keccak.Bytes.Slice(12, ByteLength)) { }
public override bool Accepts(ref KeccakStructRef topic) => true;
public bool Equals(KeccakStructRef other) => Core.Extensions.Bytes.AreEqual(other.Bytes, Bytes);
public abstract bool Accepts(ref KeccakStructRef topic);