Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Problem: v0.5.x client-cli cannot sync (fixes #1552)
Browse files Browse the repository at this point in the history
Solution: storage opened only once

(cherry-picked c0ec378)
  • Loading branch information
tomtau committed May 7, 2020
1 parent d5ee8fa commit c227cbd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Changelog

*Unreleased*
## v0.5.2 or v0.6.0
## v0.6.0
### Breaking changes
### Features
### Improvements
### Bug Fixes

*May 7, 2020*

This release contains a hotfix for client-cli sync issue.
## v0.5.2
### Bug Fixes
- *client* [1553](https://github.com/crypto-com/chain/pull/1553): client-cli cannot sync

*May 4, 2020*

This release contains a hotfix for version reporting of chain-abci.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "client-cli"
version = "0.5.0"
version = "0.5.2"
authors = ["Devashish Dixit <[email protected]>"]
edition = "2018"
build = "build.rs"
Expand Down
11 changes: 6 additions & 5 deletions client-cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,17 @@ impl Command {
let tendermint_client = WebsocketRpcClient::new(&tendermint_url())?;
let tx_obfuscation = get_tx_query(tendermint_client.clone())?;
let enckey = ask_seckey(None)?;
let storage = SledStorage::new(storage_path())?;
let config = ObfuscationSyncerConfig::new(
SledStorage::new(storage_path())?,
storage.clone(),
tendermint_client,
tx_obfuscation,
!*disable_fast_forward,
!*disable_address_recovery,
*batch_size,
*block_height_ensure,
);
Self::resync(config, name.clone(), enckey, *force)
Self::resync(config, name.clone(), enckey, *force, storage)
}
Command::MultiSig { multisig_command } => {
let storage = SledStorage::new(storage_path())?;
Expand Down Expand Up @@ -620,8 +621,9 @@ impl Command {
name: String,
enckey: SecKey,
force: bool,
storage: SledStorage,
) -> Result<()> {
let wallet_client = get_wallet_client()?;
let wallet_client = get_wallet_client(storage)?;

let mut init_block_height = 0;
let mut final_block_height = 0;
Expand Down Expand Up @@ -671,9 +673,8 @@ fn print_sync_warning() {
println!();
}

fn get_wallet_client() -> Result<AppWalletClient> {
fn get_wallet_client(storage: SledStorage) -> Result<AppWalletClient> {
let tendermint_client = WebsocketRpcClient::new(&tendermint_url())?;
let storage = SledStorage::new(storage_path())?;
let hw_key_service = HwKeyService::default();

let signer_manager = WalletSignerManager::new(storage.clone(), hw_key_service.clone());
Expand Down

0 comments on commit c227cbd

Please sign in to comment.