2018-11-19 22:47:40 +03:00
|
|
|
// Copyright 2018 The Grin Developers
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
/// Null Output 'plugin' implementation
|
2018-12-08 02:59:40 +03:00
|
|
|
use crate::core::libtx::slate::Slate;
|
|
|
|
use crate::libwallet::Error;
|
|
|
|
use crate::{WalletCommAdapter, WalletConfig};
|
2018-11-19 22:47:40 +03:00
|
|
|
|
|
|
|
use std::collections::HashMap;
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
pub struct NullWalletCommAdapter {}
|
|
|
|
|
|
|
|
impl NullWalletCommAdapter {
|
|
|
|
/// Create
|
|
|
|
pub fn new() -> Box<NullWalletCommAdapter> {
|
|
|
|
Box::new(NullWalletCommAdapter {})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl WalletCommAdapter for NullWalletCommAdapter {
|
|
|
|
fn supports_sync(&self) -> bool {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
|
2018-11-26 15:35:14 +03:00
|
|
|
fn send_tx_sync(&self, _dest: &str, slate: &Slate) -> Result<Slate, Error> {
|
|
|
|
Ok(slate.clone())
|
2018-11-19 22:47:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fn send_tx_async(&self, _dest: &str, _slate: &Slate) -> Result<(), Error> {
|
2018-11-26 15:35:14 +03:00
|
|
|
Ok(())
|
2018-11-19 22:47:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
fn receive_tx_async(&self, _params: &str) -> Result<Slate, Error> {
|
|
|
|
unimplemented!();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn listen(
|
|
|
|
&self,
|
|
|
|
_params: HashMap<String, String>,
|
|
|
|
_config: WalletConfig,
|
|
|
|
_passphrase: &str,
|
|
|
|
_account: &str,
|
|
|
|
_node_api_secret: Option<String>,
|
|
|
|
) -> Result<(), Error> {
|
|
|
|
unimplemented!();
|
|
|
|
}
|
|
|
|
}
|