public Hash GetTagValue() { if (_transaction.Tag == null) { byte[] tagBytes = Converter.AllocateBytesForTrits(TagTrinarySize); Converter.Bytes(Trits(), TagTrinaryOffset, tagBytes, 0, TagTrinarySize); _transaction.Tag = new Hash(tagBytes, 0, TagSize); } return(_transaction.Tag); }
public TransactionViewModel(int[] trits, Hash hash) { _transaction = new Transaction(); _trits = new int[trits.Length]; Array.Copy(trits, 0, _trits, 0, trits.Length); _transaction.Bytes = Converter.AllocateBytesForTrits(trits.Length); Converter.Bytes(trits, 0, _transaction.Bytes, 0, trits.Length); _hash = hash; _transaction.Type = FilledSlot; WeightMagnitude = _hash.TrailingZeros(); _transaction.Validity = 0; _transaction.ArrivalTime = 0; }