public Keccak SendTransaction(PublicEntry publicEntry) { TransactionBroadcast broadcast = new TransactionBroadcast { PublicEntry = publicEntry }; _transactionReceived.OnTransactionReceived(broadcast.ToProtocolMessage(_peerId)); byte[] kvmAddressBytes = Keccak.Compute(publicEntry.SenderAddress.ToByteArray()).Bytes.AsSpan(12).ToArray(); string hex = kvmAddressBytes.ToHexString() ?? throw new ArgumentNullException("kvmAddressBytes.ToHexString()"); publicEntry.SenderAddress = kvmAddressBytes.ToByteString(); if (publicEntry.ReceiverAddress.Length == 1) { publicEntry.ReceiverAddress = ByteString.Empty; } return(publicEntry.GetHash(HashProvider)); }
/// <summary> /// Gets the document id on the basis of <paramref name="entry"/> content. /// </summary> public static string GetDocumentId(this PublicEntry entry, IHashProvider hashProvider) => entry.GetHash(hashProvider).AsDocumentId();