Skip to content

Commit

Permalink
GH-728: add TODO to implement handler for ConfigurationChange::Update…
Browse files Browse the repository at this point in the history
…Password inside BlockchainBridge
  • Loading branch information
utkarshg6 committed Nov 2, 2023
1 parent 4d07e27 commit 04533e4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions node/src/blockchain/blockchain_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ impl Handler<ConfigurationChangeMessage> for BlockchainBridge {

fn handle(&mut self, msg: ConfigurationChangeMessage, ctx: &mut Self::Context) -> Self::Result {
todo!("handler for BlockchainBridge");
// TODO: GH-728 - what should we do once the message is received
}
}

Expand Down Expand Up @@ -554,6 +555,7 @@ mod tests {
use crate::db_config::persistent_configuration::PersistentConfigError;
use crate::match_every_type_id;
use crate::node_test_utils::check_timestamp;
use crate::sub_lib::neighborhood::ConfigurationChange::UpdatePassword;
use crate::test_utils::persistent_configuration_mock::PersistentConfigurationMock;
use crate::test_utils::recorder::{make_recorder, peer_actors_builder};
use crate::test_utils::recorder_stop_conditions::StopCondition;
Expand Down Expand Up @@ -663,6 +665,31 @@ mod tests {
);
}

#[test]
fn blockchain_bridge_updates_password_when_it_receives_configuration_change_msg() {
let system = System::new(
"blockchain_bridge_updates_password_when_it_receives_configuration_change_msg",
);
let subject = BlockchainBridge::new(
stub_bi(),
Box::new(PersistentConfigurationMock::default()),
false,
None,
);
let subject_addr = subject.start();
let peer_actors = peer_actors_builder().build();
subject_addr.try_send(BindMessage { peer_actors }).unwrap();

subject_addr
.try_send(ConfigurationChangeMessage {
change: UpdatePassword("new_password".to_string()),
})
.unwrap();

System::current().stop();
assert_eq!(system.run(), 0);
}

#[test]
fn qualified_payables_msg_is_handled_and_new_msg_with_an_added_blockchain_agent_returns_to_accountant(
) {
Expand Down

0 comments on commit 04533e4

Please sign in to comment.