Skip to content

Commit 0a7e791

Browse files
apollo_consensus_orchestrator,apollo_consensus_manager: add strk_exchange_rate_oracle field to deps
1 parent a488daa commit 0a7e791

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

crates/apollo_consensus_manager/src/consensus_manager.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ impl ConsensusManager {
304304
outbound_proposal_sender: outbound_internal_sender,
305305
vote_broadcast_client: votes_broadcast_channels.broadcast_topic_client.clone(),
306306
config_manager_client: Some(Arc::clone(&config_manager_client)),
307+
strk_exchange_rate_oracle: None,
307308
},
308309
)
309310
}

crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use apollo_config::behavior_mode::BehaviorMode;
2323
use apollo_config_manager_types::communication::SharedConfigManagerClient;
2424
use apollo_consensus::types::{ConsensusContext, ConsensusError, ProposalCommitment, Round};
2525
use apollo_consensus_orchestrator_config::config::ContextConfig;
26-
use apollo_l1_gas_price_types::L1GasPriceProviderClient;
26+
use apollo_l1_gas_price_types::{ExchangeRateOracleClientTrait, L1GasPriceProviderClient};
2727
use apollo_network::network_manager::{BroadcastTopicClient, BroadcastTopicClientTrait};
2828
use apollo_protobuf::consensus::{
2929
BuildParam,
@@ -250,6 +250,8 @@ pub struct SequencerConsensusContextDeps {
250250
// Used to broadcast votes to other consensus nodes.
251251
pub vote_broadcast_client: BroadcastTopicClient<Vote>,
252252
pub config_manager_client: Option<SharedConfigManagerClient>,
253+
/// STRK/USD exchange rate oracle for SNIP-35 dynamic gas pricing. None if disabled.
254+
pub strk_exchange_rate_oracle: Option<Arc<dyn ExchangeRateOracleClientTrait>>,
253255
}
254256

255257
#[derive(thiserror::Error, PartialEq, Debug)]

crates/apollo_consensus_orchestrator/src/test_utils.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ pub(crate) struct TestDeps {
127127
pub clock: Arc<dyn Clock>,
128128
pub outbound_proposal_sender: mpsc::Sender<(HeightAndRound, mpsc::Receiver<ProposalPart>)>,
129129
pub vote_broadcast_client: BroadcastTopicClient<Vote>,
130+
pub strk_exchange_rate_oracle:
131+
Option<Arc<dyn apollo_l1_gas_price_types::ExchangeRateOracleClientTrait>>,
130132
}
131133

132134
impl From<TestDeps> for SequencerConsensusContextDeps {
@@ -141,6 +143,7 @@ impl From<TestDeps> for SequencerConsensusContextDeps {
141143
outbound_proposal_sender: deps.outbound_proposal_sender,
142144
vote_broadcast_client: deps.vote_broadcast_client,
143145
config_manager_client: None,
146+
strk_exchange_rate_oracle: deps.strk_exchange_rate_oracle,
144147
}
145148
}
146149
}
@@ -367,6 +370,7 @@ pub(crate) fn create_test_and_network_deps() -> (TestDeps, NetworkDependencies)
367370
clock,
368371
outbound_proposal_sender,
369372
vote_broadcast_client: votes_topic_client,
373+
strk_exchange_rate_oracle: None,
370374
};
371375

372376
let network_deps =

0 commit comments

Comments
 (0)