Skip to content

Commit ccb5be3

Browse files
apollo_consensus_orchestrator,apollo_consensus_manager: add strk_price_oracle field to deps
1 parent 88a4a65 commit ccb5be3

3 files changed

Lines changed: 7 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_price_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::{L1GasPriceProviderClient, PriceOracleClientTrait};
2727
use apollo_network::network_manager::{BroadcastTopicClient, BroadcastTopicClientTrait};
2828
use apollo_protobuf::consensus::{
2929
BuildParam,
@@ -249,6 +249,8 @@ pub struct SequencerConsensusContextDeps {
249249
// Used to broadcast votes to other consensus nodes.
250250
pub vote_broadcast_client: BroadcastTopicClient<Vote>,
251251
pub config_manager_client: Option<SharedConfigManagerClient>,
252+
/// STRK/USD price oracle for SNIP-35 dynamic gas pricing. None if disabled.
253+
pub strk_price_oracle: Option<Arc<dyn PriceOracleClientTrait>>,
252254
}
253255

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

crates/apollo_consensus_orchestrator/src/test_utils.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ 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_price_oracle: Option<Arc<dyn apollo_l1_gas_price_types::PriceOracleClientTrait>>,
130131
}
131132

132133
impl From<TestDeps> for SequencerConsensusContextDeps {
@@ -141,6 +142,7 @@ impl From<TestDeps> for SequencerConsensusContextDeps {
141142
outbound_proposal_sender: deps.outbound_proposal_sender,
142143
vote_broadcast_client: deps.vote_broadcast_client,
143144
config_manager_client: None,
145+
strk_price_oracle: deps.strk_price_oracle,
144146
}
145147
}
146148
}
@@ -367,6 +369,7 @@ pub(crate) fn create_test_and_network_deps() -> (TestDeps, NetworkDependencies)
367369
clock,
368370
outbound_proposal_sender,
369371
vote_broadcast_client: votes_topic_client,
372+
strk_price_oracle: None,
370373
};
371374

372375
let network_deps =

0 commit comments

Comments
 (0)