Esempio n. 1
0
 internal Invoice(TransactionBody transactionBody)
 {
     _txId       = Protobuf.FromTransactionId(transactionBody.TransactionID);
     _memo       = transactionBody.Memo;
     _txBytes    = transactionBody.ToByteArray();
     _signatures = new Dictionary <ByteString, SignaturePair>();
 }
Esempio n. 2
0
 internal static void PreCheck(TransactionID transactionId, ResponseCodeEnum code)
 {
     if (code == Proto.ResponseCodeEnum.Ok)
     {
         return;
     }
     throw new PrecheckException($"Transaction Failed Pre-Check: {code}", Protobuf.FromTransactionId(transactionId), (ResponseCode)code);
 }
Esempio n. 3
0
 internal static void PreCheck(TransactionID transactionId, TransactionResponse response)
 {
     if (response.NodeTransactionPrecheckCode == Proto.ResponseCodeEnum.Ok)
     {
         return;
     }
     throw new PrecheckException($"Transaction Failed Pre-Check: {response.NodeTransactionPrecheckCode}", Protobuf.FromTransactionId(transactionId), (ResponseCode)response.NodeTransactionPrecheckCode, response.Cost);
 }
Esempio n. 4
0
 internal static void ResponseHeader(TransactionID transactionId, ResponseHeader?header)
 {
     if (header == null)
     {
         throw new PrecheckException($"Transaction Failed to Produce a Response.", Protobuf.FromTransactionId(transactionId), ResponseCode.Unknown, 0);
     }
     if (header.NodeTransactionPrecheckCode == Proto.ResponseCodeEnum.Ok)
     {
         return;
     }
     throw new PrecheckException($"Transaction Failed Pre-Check: {header.NodeTransactionPrecheckCode}", Protobuf.FromTransactionId(transactionId), (ResponseCode)header.NodeTransactionPrecheckCode, header.Cost);
 }