Convert node client to use V2 Node API (#329)

* add beginnings of jsonrpc node client, get_chain_tip implementation

* version info and outputs from node

* return async split up of get_output requests

* add and test get kernel functionality

* height range to pmmr indices

* test fixes

* outputs by pmmr index
This commit is contained in:
Yeastplume
2020-02-14 09:16:43 +00:00
committed by GitHub
parent a92b8d44b3
commit 4bb0398e21
13 changed files with 671 additions and 230 deletions
+2 -5
View File
@@ -18,8 +18,6 @@ use uuid::Uuid;
use crate::grin_core::core::hash::Hashed;
use crate::grin_core::core::Transaction;
use crate::grin_core::ser;
use crate::grin_util;
use crate::grin_util::secp::key::SecretKey;
use crate::grin_util::Mutex;
use crate::util::OnionV3Address;
@@ -28,7 +26,7 @@ use crate::api_impl::owner_updater::StatusMessage;
use crate::grin_keychain::{Identifier, Keychain};
use crate::internal::{keys, scan, selection, tx, updater};
use crate::slate::{PaymentInfo, Slate};
use crate::types::{AcctPathMapping, NodeClient, TxLogEntry, TxWrapper, WalletBackend, WalletInfo};
use crate::types::{AcctPathMapping, NodeClient, TxLogEntry, WalletBackend, WalletInfo};
use crate::{
address, wallet_lock, InitTxArgs, IssueInvoiceTxArgs, NodeHeightResult, OutputCommitMapping,
PaymentProof, ScannedBlockInfo, TxLogEntryType, WalletInitStatus, WalletInst, WalletLCProvider,
@@ -632,8 +630,7 @@ pub fn post_tx<'a, C>(client: &C, tx: &Transaction, fluff: bool) -> Result<(), E
where
C: NodeClient + 'a,
{
let tx_hex = grin_util::to_hex(ser::ser_vec(tx, ser::ProtocolVersion(1)).unwrap());
let res = client.post_tx(&TxWrapper { tx_hex: tx_hex }, fluff);
let res = client.post_tx(tx, fluff);
if let Err(e) = res {
error!("api: post_tx: failed with error: {}", e);
Err(e)