Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
themicp committed Jan 12, 2024
1 parent d711d7d commit a76023c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
8 changes: 3 additions & 5 deletions contracts/light-client/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use cosmwasm_std::{
};

use crate::error::ContractError;
use crate::lightclient::helpers::calc_sync_period;
use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};
use crate::{lightclient::LightClient, state::*};
use eyre::Result;
Expand Down Expand Up @@ -114,8 +113,7 @@ mod tests {
use types::lightclient::LightClientState;
use types::proofs::UpdateVariant;
use types::ssz_rs::Node;
use types::sync_committee_rs::consensus_types::SyncCommittee;
use types::sync_committee_rs::constants::{BlsSignature, SYNC_COMMITTEE_SIZE};
use types::sync_committee_rs::constants::BlsSignature;

use crate::msg::{InstantiateMsg, QueryMsg};
use crate::types::VerificationResult;
Expand Down Expand Up @@ -379,7 +377,7 @@ mod tests {
(String::from("workersetmessage:0xcaabfb4729c106140393eaceca29a0d90e5e64297bb9adbec9c3c7d49c9fab61:0"), String::from("OK"))
]
);
for (index, content) in contents.iter().enumerate() {
for (_index, content) in contents.iter().enumerate() {
match content {
// this is the first content, with the broken transaction proof
ContentVariant::Message(m) => {
Expand Down Expand Up @@ -411,7 +409,7 @@ mod tests {

#[test]
fn test_config_query() {
let (mut app, addr) = deploy(None);
let (app, addr) = deploy(None);

let config: Config = app
.wrap()
Expand Down
7 changes: 3 additions & 4 deletions contracts/light-client/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use types::sync_committee_rs::constants::MAX_BYTES_PER_TRANSACTION;
use types::{common::ContentVariant, consensus::Update};

use crate::lightclient::helpers::{
calc_sync_period, compare_content_with_log, extract_logs_from_receipt_proof, parse_message_id,
compare_content_with_log, extract_logs_from_receipt_proof, parse_message_id,
verify_ancestry_proof, verify_transaction_proof,
};
use crate::lightclient::LightClient;
Expand Down Expand Up @@ -189,8 +189,7 @@ pub fn light_client_update(
pub mod tests {
use crate::execute::{process_block_proofs, process_transaction_proofs, verify_content};
use crate::lightclient::helpers::test_helpers::{
filter_message_variants, filter_workerset_variants, filter_workeset_message_variants,
get_batched_data, get_config,
filter_message_variants, filter_workerset_variants, get_batched_data, get_config,
};
use crate::lightclient::helpers::{extract_logs_from_receipt_proof, parse_message_id};
use crate::lightclient::tests::tests::init_lightclient;
Expand Down Expand Up @@ -504,7 +503,7 @@ pub mod tests {

let AncestryProof::BlockRoots {
block_root_proof,
block_roots_index,
block_roots_index: _,
} = &mut target_block.ancestry_proof
else {
panic!("")
Expand Down
3 changes: 1 addition & 2 deletions contracts/light-client/src/lightclient/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,7 @@ pub mod test_helpers {
use types::connection_router::state::Message;
use types::execution::ReceiptLog;
use types::proofs::{
BatchVerificationData, BlockProofsBatch, CrossChainId, TransactionProofsBatch,
UpdateVariant,
BatchVerificationData, CrossChainId, TransactionProofsBatch, UpdateVariant,
};
use types::ssz_rs::Node;
use types::{
Expand Down
5 changes: 3 additions & 2 deletions contracts/light-client/src/lightclient/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub mod tests {
client
}

#[test]
fn test_apply_bootstrap() {
let config = get_config();
let env = mock_env();
Expand All @@ -70,7 +71,7 @@ pub mod tests {
assert!(client.bootstrap(&bootstrap).is_err());

// test normal bootstrap
let mut bootstrap = get_bootstrap();
let bootstrap = get_bootstrap();
assert!(client.bootstrap(&bootstrap).is_ok());

assert_eq!(
Expand Down Expand Up @@ -1027,7 +1028,7 @@ pub mod tests {
// TODO: need two updates from the same period
fn test_apply_same_period_update() {
let mut lightclient = init_lightclient(None);
let mut update = get_update(862);
let update = get_update(862);

assert!(lightclient.apply_update(&update).is_ok());
let state_before_update = lightclient.state.clone();
Expand Down

0 comments on commit a76023c

Please sign in to comment.