Skip to content

Commit

Permalink
refactor: remove one liner helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Daanvdplas committed Sep 13, 2024
1 parent d42c203 commit 1dc364c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
12 changes: 6 additions & 6 deletions pop-api/integration-tests/src/fungibles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,19 @@ fn token_metadata_works() {
let decimals: u8 = 69;

// Token does not exist.
assert_eq!(token_name(&addr, TOKEN_ID), Ok(assets::token_name(TOKEN_ID)));
assert_eq!(token_name(&addr, TOKEN_ID), Ok(Assets::name(TOKEN_ID)));
assert_eq!(token_name(&addr, TOKEN_ID), Ok(Vec::<u8>::new()));
assert_eq!(token_symbol(&addr, TOKEN_ID), Ok(assets::token_symbol(TOKEN_ID)));
assert_eq!(token_symbol(&addr, TOKEN_ID), Ok(Assets::symbol(TOKEN_ID)));
assert_eq!(token_symbol(&addr, TOKEN_ID), Ok(Vec::<u8>::new()));
assert_eq!(token_decimals(&addr, TOKEN_ID), Ok(assets::token_decimals(TOKEN_ID)));
assert_eq!(token_decimals(&addr, TOKEN_ID), Ok(Assets::decimals(TOKEN_ID)));
assert_eq!(token_decimals(&addr, TOKEN_ID), Ok(0));
// Create Token.
assets::create_and_set_metadata(&addr, TOKEN_ID, name.clone(), symbol.clone(), decimals);
assert_eq!(token_name(&addr, TOKEN_ID), Ok(assets::token_name(TOKEN_ID)));
assert_eq!(token_name(&addr, TOKEN_ID), Ok(Assets::name(TOKEN_ID)));
assert_eq!(token_name(&addr, TOKEN_ID), Ok(name));
assert_eq!(token_symbol(&addr, TOKEN_ID), Ok(assets::token_symbol(TOKEN_ID)));
assert_eq!(token_symbol(&addr, TOKEN_ID), Ok(Assets::symbol(TOKEN_ID)));
assert_eq!(token_symbol(&addr, TOKEN_ID), Ok(symbol));
assert_eq!(token_decimals(&addr, TOKEN_ID), Ok(assets::token_decimals(TOKEN_ID)));
assert_eq!(token_decimals(&addr, TOKEN_ID), Ok(Assets::decimals(TOKEN_ID)));
assert_eq!(token_decimals(&addr, TOKEN_ID), Ok(decimals));
});
}
Expand Down
12 changes: 0 additions & 12 deletions pop-api/integration-tests/src/fungibles/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,18 +308,6 @@ pub(super) mod assets {
decimals
));
}

pub(crate) fn token_name(asset_id: AssetId) -> Vec<u8> {
Assets::name(asset_id)
}

pub(crate) fn token_symbol(asset_id: AssetId) -> Vec<u8> {
Assets::symbol(asset_id)
}

pub(crate) fn token_decimals(asset_id: AssetId) -> u8 {
Assets::decimals(asset_id)
}
}

pub(super) fn instantiate_and_create_fungible(
Expand Down

0 comments on commit 1dc364c

Please sign in to comment.