From 179a302b990a3e605f5a54edde29bef7b3f4b753 Mon Sep 17 00:00:00 2001 From: Unique-Divine Date: Thu, 11 Jan 2024 00:09:02 -0600 Subject: [PATCH] refactor: delete the now unused macro, cw_custom --- Cargo.lock | 10 -------- Cargo.toml | 1 - packages/nibiru-macro/Cargo.toml | 20 --------------- packages/nibiru-macro/src/lib.rs | 43 -------------------------------- 4 files changed, 74 deletions(-) delete mode 100644 packages/nibiru-macro/Cargo.toml delete mode 100644 packages/nibiru-macro/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 26f5883..49b5e3e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1800,16 +1800,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "nibiru-macro" -version = "0.1.0" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "quote", - "syn 2.0.43", -] - [[package]] name = "nibiru-std" version = "0.0.5" diff --git a/Cargo.toml b/Cargo.toml index 8490d08..2f6911a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,6 @@ serde_json = "1.0.108" nibiru-std = { path = "nibiru-std" } prost = "0.12.3" prost-types = "0.12.3" -nibiru-macro = { path = "packages/nibiru-macro" } bash-rs = { path = "packages/bash-rs" } # deps: CosmWasm diff --git a/packages/nibiru-macro/Cargo.toml b/packages/nibiru-macro/Cargo.toml deleted file mode 100644 index ff28cea..0000000 --- a/packages/nibiru-macro/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "nibiru-macro" -version = "0.1.0" -edition = "2021" -description = "Procedural macros for Nibiru CosmWasm smart contracts" -keywords = ["nibiru", "blockchain", "macro", "cosmwasm"] - -# lib: See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[lib] -proc-macro = true - -[features] -backtraces = ["cosmwasm-std/backtraces"] -library = [] - -[dependencies] -cosmwasm-std = { workspace = true } -cosmwasm-schema = { workspace = true } -quote = "1.0.33" -syn = "2.0.38" \ No newline at end of file diff --git a/packages/nibiru-macro/src/lib.rs b/packages/nibiru-macro/src/lib.rs deleted file mode 100644 index 6233a90..0000000 --- a/packages/nibiru-macro/src/lib.rs +++ /dev/null @@ -1,43 +0,0 @@ -use proc_macro::TokenStream; -use quote::quote; -use syn::{parse_macro_input, DeriveInput}; - -/// cw_custom: A procedural macro attribute that generates implementations of: -/// (1) the `cosmwasm_std::CustomMsg` trait and (2) the `From` trait for -/// converting the input type into an instance of `cosmwasm_std::CosmosMsg`. -/// -/// # Example -/// -/// ``` -/// use nibiru_macro::cw_custom; -/// use cosmwasm_std::{CustomMsg, CosmosMsg}; -/// use cosmwasm_schema::{cw_serde}; -/// -/// #[cw_serde] -/// #[cw_custom] -/// pub struct MyCustomMsg { -/// // struct fields... -/// } -/// ``` -#[proc_macro_attribute] -pub fn cw_custom(_attr: TokenStream, input: TokenStream) -> TokenStream { - let ast = parse_macro_input!(input as DeriveInput); - - let name = &ast.ident; - - let gen = quote! { - #ast - - impl CustomMsg for #name {} - - /// This implementation of the "From" trait converts instances of the #name - /// type into `CossmosMsg` objects. - impl From<#name> for CosmosMsg<#name> { - fn from(original: #name) -> Self { - CosmosMsg::Custom(original) - } - } - }; - - gen.into() -}