mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-12-05 13:23:58 +01:00
V2 Slate Compatibility (#272)
* re-insert v2 slate * reinstate version conversions * rustfmt * add and test versioning checks against 2.0.0 wallets * rustfmt * fix to invoice file output * doctest fix * remove target slate version from command line options
This commit is contained in:
@@ -513,9 +513,7 @@ where
|
||||
{
|
||||
controller::owner_single_use(wallet.clone(), keychain_mask, |api, m| {
|
||||
let slate = api.issue_invoice_tx(m, args.issue_args)?;
|
||||
let mut tx_file = File::create(args.dest.clone())?;
|
||||
tx_file.write_all(json::to_string(&slate).unwrap().as_bytes())?;
|
||||
tx_file.sync_all()?;
|
||||
PathToSlate((&args.dest).into()).put_tx(&slate)?;
|
||||
Ok(())
|
||||
})?;
|
||||
Ok(())
|
||||
|
||||
@@ -19,7 +19,7 @@ use crate::config::TorConfig;
|
||||
use crate::keychain::Keychain;
|
||||
use crate::libwallet::{
|
||||
address, Error, ErrorKind, NodeClient, NodeVersionInfo, Slate, WalletInst, WalletLCProvider,
|
||||
CURRENT_SLATE_VERSION, GRIN_BLOCK_HEADER_VERSION,
|
||||
GRIN_BLOCK_HEADER_VERSION,
|
||||
};
|
||||
use crate::util::secp::key::SecretKey;
|
||||
use crate::util::{from_hex, static_secp_instance, to_base64, Mutex};
|
||||
@@ -63,10 +63,7 @@ fn check_middleware(
|
||||
bhv = n.block_header_version;
|
||||
}
|
||||
if let Some(s) = slate {
|
||||
if s.version_info.version < CURRENT_SLATE_VERSION
|
||||
// || (bhv == 3 && s.version_info.block_header_version != 3)
|
||||
|| (bhv > 3 && s.version_info.block_header_version < GRIN_BLOCK_HEADER_VERSION)
|
||||
{
|
||||
if bhv > 3 && s.version_info.block_header_version < GRIN_BLOCK_HEADER_VERSION {
|
||||
Err(ErrorKind::Compatibility(
|
||||
"Incoming Slate is not compatible with this wallet. \
|
||||
Please upgrade the node or use a different one."
|
||||
|
||||
Reference in New Issue
Block a user