예제 #1
0
        public void CanSerializeSampleTransaction()
        {
            JsonRpcTransactionResponse response = JsonConvert.DeserializeObject <JsonRpcTransactionResponse>(SampleTransactionJson);

            Assert.Equal(SampleTransactionBlockHash, response.BlockHash);
            Assert.Equal(SampleTransactionBlockNumber, response.BlockNumber);
            Assert.Equal(SampleTransaction1Value, response.Value);
        }
예제 #2
0
 public static TransactionViewModel FromTransactionResponse(JsonRpcTransactionResponse apiTransactionResponse)
 {
     return(new TransactionViewModel
     {
         From = apiTransactionResponse.From,
         To = apiTransactionResponse.To,
         Gas = apiTransactionResponse.Gas.HexToUint(),
         TxHash = apiTransactionResponse.Hash,
         Value = apiTransactionResponse.Value.HexToEthValue()
     });
 }