Skip to content

Commit

Permalink
Clean up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
erikreppel committed Apr 26, 2024
1 parent ecca05a commit 0d5dec1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 45 deletions.
18 changes: 5 additions & 13 deletions src/chain.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
use std::sync::Arc;

// use alloy_primitives::{address, Address, Bytes};
// use alloy_provider::Provider;
// use alloy_rpc_types::{Filter, TransactionInput, TransactionRequest};
// use alloy_sol_macro::sol;
// use alloy_sol_types::{SolCall, SolEvent};
use crate::chain_list::{ChainListProvider, CHAINS};
use crate::controller::{ControllerCommands, ControllerInterface};
use crate::premints::zora_premint_v2::types::PREMINT_FACTORY_ADDR;
use crate::types::{InclusionClaim, Premint, PremintTypes};
use alloy::primitives::{address, Address, Bytes, TxKind};
use alloy::providers::Provider;
use alloy::rpc::types::eth::{BlockId, Filter, TransactionInput, TransactionRequest};
use alloy::sol;
use alloy::sol_types::{SolCall, SolEvent};

use futures_util::StreamExt;

use crate::chain_list::{ChainListProvider, CHAINS};
use crate::controller::{ControllerCommands, ControllerInterface};
use crate::premints::zora_premint_v2::types::PREMINT_FACTORY_ADDR;
use crate::types::{InclusionClaim, Premint, PremintTypes};
use std::sync::Arc;

/// Helper function for calling view functions for SolCall types
pub async fn view_contract_call<T>(
Expand Down
24 changes: 5 additions & 19 deletions src/chain_list.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
use std::sync::Arc;
use std::time::Duration;

use alloy::network::{Ethereum, Network};
// use alloy::providers::layers;
use alloy::providers::fillers::{ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller};
use alloy::providers::{Identity, ProviderBuilder, RootProvider};
use alloy::network::Network;
use alloy::providers::{ProviderBuilder, RootProvider};
use alloy::pubsub::PubSubFrontend;
use alloy::rpc::client::WsConnect;

// use alloy_provider::layers::{GasEstimatorProvider, ManagedNonceProvider};
// use alloy_provider::{Identity, ProviderBuilder, RootProvider};
// use alloy_rpc_client::WsConnect;
use eyre::ContextCompat;
use mini_moka::sync::Cache;
use once_cell::sync::Lazy;
use regex::Regex;
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use std::time::Duration;

const CHAINS_JSON: &str = include_str!("../data/chains.json");

Expand Down Expand Up @@ -82,14 +75,7 @@ impl Chains {
Some(provider) => Ok(provider),
None => {
let conn = WsConnect::new(url);
let provider = ProviderBuilder::new()
// .with_recommended_fillers()
.on_ws(conn)
.await?;
// let provider: ChainListProvider<N> = ProviderBuilder::<Identity, N>::default()
// .with_recommended_layers()
// .on_ws(conn)
// .await?;
let provider = ProviderBuilder::new().on_ws(conn).await?;

let arc = Arc::new(provider);

Expand Down
10 changes: 3 additions & 7 deletions src/premints/zora_premint_v2/rules.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
use std::str::FromStr;

// use alloy_primitives::Signature;
// use alloy_sol_types::SolStruct;
use alloy::primitives::Signature;
use alloy::sol_types::SolStruct;

use crate::chain::view_contract_call;
use crate::premints::zora_premint_v2::types::{
IZoraPremintV2, ZoraPremintV2, PREMINT_FACTORY_ADDR,
Expand All @@ -14,6 +7,9 @@ use crate::rules::{Evaluation, Rule, RuleContext};
use crate::storage::Reader;
use crate::types::PremintTypes;
use crate::{ignore, reject, typed_rule};
use alloy::primitives::Signature;
use alloy::sol_types::SolStruct;
use std::str::FromStr;

// create premint v2 rule implementations here

Expand Down
9 changes: 3 additions & 6 deletions src/storage.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
use std::str::FromStr;

// use alloy_primitives::Address;
use crate::config::Config;
use crate::types::{InclusionClaim, Premint, PremintName, PremintTypes};
use alloy::primitives::Address;
use async_trait::async_trait;
use eyre::WrapErr;
use serde::{Deserialize, Serialize};
use sqlx::sqlite::SqliteConnectOptions;
use sqlx::Row;
use sqlx::{QueryBuilder, Sqlite, SqlitePool};

use crate::config::Config;
use crate::types::{InclusionClaim, Premint, PremintName, PremintTypes};
use std::str::FromStr;

async fn init_db(config: &Config) -> SqlitePool {
let expect_msg =
Expand Down

0 comments on commit 0d5dec1

Please sign in to comment.