Skip to content

Commit

Permalink
Problem (Fix crypto-com#1527): app version not set on the first startup
Browse files Browse the repository at this point in the history
Solution:
- Set version in info handler regardless of state
  • Loading branch information
yihuang authored and allthatjazzleo committed May 19, 2020
1 parent 206a051 commit 740595e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chain-abci/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ impl<T: EnclaveProxy> abci::Application for ChainNodeApp<T> {
fn info(&mut self, _req: &RequestInfo) -> ResponseInfo {
info!("received info request");
let mut resp = ResponseInfo::new();
resp.app_version = chain_core::APP_VERSION;
resp.version = get_version();
if let Some(app_state) = &self.last_state {
resp.last_block_app_hash = app_state.last_apphash.to_vec();
resp.last_block_height = app_state.last_block_height.value().try_into().unwrap();
resp.app_version = chain_core::APP_VERSION;
resp.version = get_version();
resp.data = serde_json::to_string(&app_state).expect("serialize app state to json");
} else {
resp.last_block_app_hash = self.genesis_app_hash.to_vec();
Expand Down

0 comments on commit 740595e

Please sign in to comment.