Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use zink macros #112

Merged
merged 2 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azns_fee_calculator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
ink = { version = "4.2.1", default-features = false }

util_macros = { path = "../util_macros" }
zink = { git = "https://github.com/scio-labs/zink" }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }
Expand Down
4 changes: 2 additions & 2 deletions azns_fee_calculator/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ macro_rules! ensure {

pub use self::azns_fee_calculator::{FeeCalculator, FeeCalculatorRef};

#[util_macros::azns_contract(Ownable2Step[
#[zink::coating(Ownable2Step[
Error = Error::NotAdmin
])]
#[util_macros::azns_contract(Upgradable)]
#[zink::coating(Upgradable)]
#[ink::contract]
mod azns_fee_calculator {
use super::*;
Expand Down
2 changes: 1 addition & 1 deletion azns_merkle_verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
ink = { version = "4.2.1", default-features = false }

util_macros = { path = "../util_macros" }
zink = { git = "https://github.com/scio-labs/zink" }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }
Expand Down
4 changes: 2 additions & 2 deletions azns_merkle_verifier/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

pub use self::merkle_verifier::{MerkleVerifier, MerkleVerifierRef};

#[util_macros::azns_contract(Ownable2Step[
#[zink::coating(Ownable2Step[
Error = Error::NotAdmin
])]
#[util_macros::azns_contract(Upgradable)]
#[zink::coating(Upgradable)]
#[ink::contract]
mod merkle_verifier {

Expand Down
2 changes: 1 addition & 1 deletion azns_name_checker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false
[dependencies]
ink = { version = "4.2.1", default-features = false }

util_macros = { path = "../util_macros" }
zink = { git = "https://github.com/scio-labs/zink" }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }
Expand Down
4 changes: 2 additions & 2 deletions azns_name_checker/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ impl UnicodeRange {
}
}

#[util_macros::azns_contract(Ownable2Step[
#[zink::coating(Ownable2Step[
Error = Error::NotAdmin
])]
#[util_macros::azns_contract(Upgradable)]
#[zink::coating(Upgradable)]
#[ink::contract]
mod azns_name_checker {
use crate::UnicodeRange;
Expand Down
2 changes: 1 addition & 1 deletion azns_registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false
[dependencies]
ink = { version = "4.2.1", default-features = false }

util_macros = { path = "../util_macros" }
zink = { git = "https://github.com/scio-labs/zink" }
interfaces = { path = "../interfaces", default-features = false }

azns_name_checker = { path = "../azns_name_checker", default-features = false, features = ["ink-as-dependency"] }
Expand Down
11 changes: 7 additions & 4 deletions azns_registry/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

mod address_dict;

#[util_macros::azns_contract(Ownable2Step[
#[zink::coating(Ownable2Step[
Error = Error::NotAdmin
])]
#[util_macros::azns_contract(Upgradable)]
#[zink::coating(Upgradable)]
#[ink::contract]
mod azns_registry {
use crate::address_dict::AddressDict;
Expand Down Expand Up @@ -1571,11 +1571,14 @@ mod azns_registry {
return false;
};

let Ok((registration_time, expiration_time)) = self.get_registration_period_ref(&name) else {
let Ok((registration_time, expiration_time)) =
self.get_registration_period_ref(&name)
else {
return false;
};

let Some(approval_time) = self.operator_approvals.get(&(owner, operator, id)) else {
let Some(approval_time) = self.operator_approvals.get(&(owner, operator, id))
else {
return false;
};

Expand Down
2 changes: 1 addition & 1 deletion azns_router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
ink = { version = "4.2.1", default-features = false }

util_macros = { path = "../util_macros" }
zink = { git = "https://github.com/scio-labs/zink" }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }
Expand Down
4 changes: 2 additions & 2 deletions azns_router/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![cfg_attr(not(feature = "std"), no_std, no_main)]

#[util_macros::azns_contract(Ownable2Step[
#[zink::coating(Ownable2Step[
Error = Error::NotAdmin
])]
#[util_macros::azns_contract(Upgradable)]
#[zink::coating(Upgradable)]
#[ink::contract]
mod azns_router {
use ink::prelude::string::{String, ToString};
Expand Down
16 changes: 0 additions & 16 deletions util_macros/Cargo.toml

This file was deleted.

80 changes: 0 additions & 80 deletions util_macros/src/lib.rs

This file was deleted.

51 changes: 0 additions & 51 deletions util_macros/src/ownable2step.rs

This file was deleted.

33 changes: 0 additions & 33 deletions util_macros/src/parser.rs

This file was deleted.

19 changes: 0 additions & 19 deletions util_macros/src/upgradability.rs

This file was deleted.