public void CanSerializeSampleTransaction() { JsonRpcTransactionResponse response = JsonConvert.DeserializeObject <JsonRpcTransactionResponse>(SampleTransactionJson); Assert.Equal(SampleTransactionBlockHash, response.BlockHash); Assert.Equal(SampleTransactionBlockNumber, response.BlockNumber); Assert.Equal(SampleTransaction1Value, response.Value); }
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() }); }