From 582806820a496382f93e04446f1cf39efa092b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bierlein?= Date: Wed, 24 Apr 2024 00:09:36 +0200 Subject: [PATCH] Rename zora_premint_v2 -> zora_premint --- src/chain.rs | 2 +- src/main.rs | 2 +- src/premints/mod.rs | 2 +- src/premints/{zora_premint_v2 => zora_premint}/mod.rs | 0 src/premints/{zora_premint_v2 => zora_premint}/rules.rs | 2 +- src/premints/{zora_premint_v2 => zora_premint}/types.rs | 4 ++-- .../zora1155PremintExecutor.json | 0 src/rules.rs | 4 ++-- src/storage.rs | 2 +- src/types.rs | 6 +++--- tests/e2e_test.rs | 4 ++-- 11 files changed, 14 insertions(+), 14 deletions(-) rename src/premints/{zora_premint_v2 => zora_premint}/mod.rs (100%) rename src/premints/{zora_premint_v2 => zora_premint}/rules.rs (98%) rename src/premints/{zora_premint_v2 => zora_premint}/types.rs (97%) rename src/premints/{zora_premint_v2 => zora_premint}/zora1155PremintExecutor.json (100%) diff --git a/src/chain.rs b/src/chain.rs index b9d6cef..6b9dd0c 100644 --- a/src/chain.rs +++ b/src/chain.rs @@ -8,7 +8,7 @@ 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::premints::zora_premint::types::PREMINT_FACTORY_ADDR; use crate::types::{InclusionClaim, Premint, PremintTypes}; pub async fn contract_call(call: T, provider: &Arc) -> eyre::Result diff --git a/src/main.rs b/src/main.rs index b5b2b9b..4f645ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use clap::Parser; use mintpool::api; -use mintpool::premints::zora_premint_v2::types::ZoraPremintV2; +use mintpool::premints::zora_premint::types::ZoraPremintV2; use mintpool::rules::RulesEngine; use mintpool::run::{start_p2p_services, start_watch_chain}; use mintpool::stdin::watch_stdin; diff --git a/src/premints/mod.rs b/src/premints/mod.rs index c81cfb0..4ee9891 100644 --- a/src/premints/mod.rs +++ b/src/premints/mod.rs @@ -1,2 +1,2 @@ pub mod metadata; -pub mod zora_premint_v2; +pub mod zora_premint; diff --git a/src/premints/zora_premint_v2/mod.rs b/src/premints/zora_premint/mod.rs similarity index 100% rename from src/premints/zora_premint_v2/mod.rs rename to src/premints/zora_premint/mod.rs diff --git a/src/premints/zora_premint_v2/rules.rs b/src/premints/zora_premint/rules.rs similarity index 98% rename from src/premints/zora_premint_v2/rules.rs rename to src/premints/zora_premint/rules.rs index 1fcb8ce..65e776d 100644 --- a/src/premints/zora_premint_v2/rules.rs +++ b/src/premints/zora_premint/rules.rs @@ -4,7 +4,7 @@ use alloy_primitives::Signature; use alloy_sol_types::SolStruct; use crate::chain::contract_call; -use crate::premints::zora_premint_v2::types::{IZoraPremintV2, ZoraPremintV2}; +use crate::premints::zora_premint::types::{IZoraPremintV2, ZoraPremintV2}; use crate::rules::Evaluation::Accept; use crate::rules::{Evaluation, Rule, RuleContext}; use crate::storage::Reader; diff --git a/src/premints/zora_premint_v2/types.rs b/src/premints/zora_premint/types.rs similarity index 97% rename from src/premints/zora_premint_v2/types.rs rename to src/premints/zora_premint/types.rs index 0e13d70..c67b7a7 100644 --- a/src/premints/zora_premint_v2/types.rs +++ b/src/premints/zora_premint/types.rs @@ -1,6 +1,6 @@ use std::borrow::Cow; -use crate::premints::zora_premint_v2::types::IZoraPremintV2::PremintedV2; +use crate::premints::zora_premint::types::IZoraPremintV2::PremintedV2; use crate::types::{InclusionClaim, Premint, PremintMetadata, PremintName}; use alloy::rpc::types::eth::{Filter, Log, TransactionReceipt}; use alloy::sol_types::private::U256; @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize}; sol! { #[derive(Debug, Serialize, Deserialize, PartialEq)] IZoraPremintV2, - "src/premints/zora_premint_v2/zora1155PremintExecutor.json" + "src/premints/zora_premint/zora1155PremintExecutor.json" } // aliasing the types here for readability. the original name need to stay diff --git a/src/premints/zora_premint_v2/zora1155PremintExecutor.json b/src/premints/zora_premint/zora1155PremintExecutor.json similarity index 100% rename from src/premints/zora_premint_v2/zora1155PremintExecutor.json rename to src/premints/zora_premint/zora1155PremintExecutor.json diff --git a/src/rules.rs b/src/rules.rs index 5c0ab5c..c6b4742 100644 --- a/src/rules.rs +++ b/src/rules.rs @@ -276,7 +276,7 @@ pub fn all_rules() -> Vec>> { let mut rules: Vec>> = Vec::new(); rules.append(&mut general::all_rules()); - rules.append(&mut crate::premints::zora_premint_v2::rules::all_rules()); + rules.append(&mut crate::premints::zora_premint::rules::all_rules()); rules } @@ -455,7 +455,7 @@ mod general { #[cfg(test)] mod test { - use crate::premints::zora_premint_v2::types::ZoraPremintV2; + use crate::premints::zora_premint::types::ZoraPremintV2; use crate::rules::general::existing_token_uri; use crate::rules::Evaluation::{Accept, Reject}; use crate::storage::{PremintStorage, Writer}; diff --git a/src/storage.rs b/src/storage.rs index ac1506c..ce3afdb 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -317,7 +317,7 @@ mod test { use sqlx::Row; use crate::config::Config; - use crate::premints::zora_premint_v2::types::ZoraPremintV2; + use crate::premints::zora_premint::types::ZoraPremintV2; use crate::storage; use crate::storage::{ list_all, list_all_with_options, PremintStorage, QueryOptions, Reader, Writer, diff --git a/src/types.rs b/src/types.rs index ff5430b..62cdd10 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,4 +1,4 @@ -use crate::premints::zora_premint_v2::types::ZoraPremintV2; +use crate::premints::zora_premint::types::ZoraPremintV2; use alloy::rpc::types::eth::{Filter, Log, TransactionReceipt}; use alloy_primitives::{Address, B256, U256}; use async_trait::async_trait; @@ -178,10 +178,10 @@ pub struct PeerInclusionClaim { #[cfg(test)] mod test { use super::*; - use crate::premints::zora_premint_v2::types::IZoraPremintV2::{ + use crate::premints::zora_premint::types::IZoraPremintV2::{ ContractCreationConfig, CreatorAttribution, TokenCreationConfig, }; - use crate::premints::zora_premint_v2::types::{IZoraPremintV2, PREMINT_FACTORY_ADDR}; + use crate::premints::zora_premint::types::{IZoraPremintV2, PREMINT_FACTORY_ADDR}; use alloy::rpc::types::eth::ReceiptEnvelope; use alloy_primitives::{Bytes, LogData}; use alloy_sol_types::SolEvent; diff --git a/tests/e2e_test.rs b/tests/e2e_test.rs index a2f585a..cca84ec 100644 --- a/tests/e2e_test.rs +++ b/tests/e2e_test.rs @@ -19,8 +19,8 @@ use alloy_transport::TransportErrorKind; use mintpool::api::admin::node_info; use mintpool::config::{ChainInclusionMode, Config}; use mintpool::controller::{ControllerCommands, DBQuery}; -use mintpool::premints::zora_premint_v2::types::IZoraPremintV2::MintArguments; -use mintpool::premints::zora_premint_v2::types::{ +use mintpool::premints::zora_premint::types::IZoraPremintV2::MintArguments; +use mintpool::premints::zora_premint::types::{ IZoraPremintV2, ZoraPremintV2, PREMINT_FACTORY_ADDR, }; use mintpool::rules::RulesEngine;