Exemple #1
0
        public static Transaction MapTranactionFromProto(ProtoTransaction messageTransaction)
        {
            if (messageTransaction == null)
            {
                return(null);
            }

            DateTime.TryParseExact(messageTransaction.TransactionDatetime, "yyyy-MM-ddTHH:mm:ssZ",
                                   CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out var dateTime);

            dateTime = dateTime.ToUniversalTime();

            var obj = new Transaction(messageTransaction.TransactionId, dateTime, messageTransaction.SendingAddress);

            return(obj);
        }
Exemple #2
0
        public static ProtoTransaction MapTranactionToProto(Transaction messageTransaction)
        {
            if (messageTransaction == null)
            {
                return(null);
            }

            var proto = new ProtoTransaction()
            {
                SendingAddress      = messageTransaction.SendingAddress,
                TransactionDatetime = messageTransaction.DateTime.ToUniversalTime()
                                      .ToString("yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture),
                TransactionId = messageTransaction.TransactionId
            };

            return(proto);
        }
        public IMessage GetProtoObject()
        {
            IMessage m = new ProtoTransaction();

            m.ToByteArray();
        }
 /// <summary>
 /// Constructor used to build this Transaction with the deserialized
 /// protobuf object.
 /// </summary>
 /// <param name="proto"></param>
 public Transaction(ProtoTransaction proto)
 {
     _account = new Account();
 }