Skip to content

Commit

Permalink
chore(voyager): add #[serde(deny_unknown_fields)] to all configs (#3516)
Browse files Browse the repository at this point in the history
  • Loading branch information
benluelo authored Jan 15, 2025
2 parents b190820 + 20a5898 commit 1d457de
Show file tree
Hide file tree
Showing 25 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions voyager/modules/client-bootstrap/cometbls/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub rpc_url: String,
pub grpc_url: String,
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/client-bootstrap/ethereum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub chain_spec: PresetBaseKind,

Expand Down
1 change: 1 addition & 0 deletions voyager/modules/client-bootstrap/movement/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ impl aptos_move_ibc::ibc::ClientExt for Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
/// The address of the `IBCHandler` smart contract.
pub ibc_handler_address: AccountAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub l1_client_id: u32,
pub l2_client_id: u32,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub l1_client_id: u32,
pub l2_client_id: u32,
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/client-bootstrap/tendermint/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub rpc_url: String,
pub grpc_url: String,
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/client/cometbls/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {}

impl ClientModule for Module {
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/client/ethereum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub chain_spec: PresetBaseKind,
}
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/client/movement/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async fn main() {
pub struct Module {}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {}

type SelfConsensusState = movement_light_client_types::consensus_state::ConsensusState;
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/client/state-lens/ics23-ics23/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ async fn main() {
pub struct Module {}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {}

impl ClientModule for Module {
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/client/state-lens/ics23-mpt/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {}

impl ClientModule for Module {
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/client/tendermint/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {}

impl ClientModule for Module {
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/consensus/berachain/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub l1_client_id: u32,
pub l1_chain_id: ChainId,
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/consensus/cometbls/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub rpc_url: String,
pub grpc_url: String,
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/consensus/movement/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ impl aptos_move_ibc::ibc::ClientExt for Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
/// The address of the `IBCHandler` smart contract.
pub ibc_handler_address: AccountAddress,
Expand Down
1 change: 1 addition & 0 deletions voyager/modules/consensus/tendermint/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub rpc_url: String,
pub grpc_url: String,
Expand Down
1 change: 1 addition & 0 deletions voyager/plugins/client-update/berachain/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub l1_client_id: u32,
pub l1_chain_id: ChainId,
Expand Down
1 change: 1 addition & 0 deletions voyager/plugins/client-update/cometbls/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub chain_id: ChainId,

Expand Down
1 change: 1 addition & 0 deletions voyager/plugins/client-update/ethereum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub chain_id: ChainId,

Expand Down
1 change: 1 addition & 0 deletions voyager/plugins/client-update/movement/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ impl aptos_move_ibc::ibc::ClientExt for Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
/// The identifier of the chain
pub chain_id: ChainId,
Expand Down
1 change: 1 addition & 0 deletions voyager/plugins/client-update/state-lens/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub l0_client_id: u32,
pub l1_client_id: u32,
Expand Down
1 change: 1 addition & 0 deletions voyager/plugins/client-update/tendermint/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub chain_id: ChainId,

Expand Down
1 change: 1 addition & 0 deletions voyager/plugins/packet-filter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub connection_event_filters: Vec<ConnectionEventFilter>,
pub channel_event_filters: Vec<ChannelEventFilter>,
Expand Down
3 changes: 3 additions & 0 deletions voyager/plugins/transaction-batch/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ pub enum ClientConfigs {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub chain_id: ChainId,
pub client_configs: ClientConfigsSerde,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ClientConfig {
pub min_batch_size: usize,
pub max_batch_size: usize,
Expand All @@ -92,6 +94,7 @@ pub enum ClientConfigsSerde {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct SpecificClientConfig {
pub client_id: RawClientId,
pub min_batch_size: usize,
Expand Down
1 change: 1 addition & 0 deletions voyager/plugins/transaction/cosmos-sdk/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub struct Module {
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
pub chain_id: ChainId,
pub ibc_host_contract_address: Bech32<H256>,
Expand Down

0 comments on commit 1d457de

Please sign in to comment.