Skip to content

Commit

Permalink
test: added total_issuance check for token migration test
Browse files Browse the repository at this point in the history
  • Loading branch information
chexware committed Jul 20, 2024
1 parent dff52ad commit 398238e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/bridge/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use sp_core::H256;
use sp_runtime::traits::AccountIdConversion;
use sp_runtime::{traits::IdentityLookup, ModuleError, Perbill};

use core_primitives::{Attributes, CollectionType, NFTTrait, NftClassData, NftMetadata, TokenType, NftAssetData};
use core_primitives::{Attributes, CollectionType, NFTTrait, NftAssetData, NftClassData, NftMetadata, TokenType};
use primitives::{
continuum::MapTrait, Amount, ClassId, EstateId, FungibleTokenId, GroupCollectionId, MapSpotId, TokenId,
UndeployedLandBlockId,
Expand Down
5 changes: 4 additions & 1 deletion pallets/governance/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ use sp_runtime::{
};
use sp_std::collections::btree_map::BTreeMap;

use metaverse_primitive::{Attributes, CollectionType, MetaverseInfo as MetaversePrimitiveInfo, MetaverseLandTrait, MetaverseMetadata, MetaverseTrait, NFTTrait, NftClassData, NftMetadata, TokenType, NftAssetData};
use metaverse_primitive::{
Attributes, CollectionType, MetaverseInfo as MetaversePrimitiveInfo, MetaverseLandTrait, MetaverseMetadata,
MetaverseTrait, NFTTrait, NftAssetData, NftClassData, NftMetadata, TokenType,
};
use primitives::{Amount, ClassId, FungibleTokenId, GroupCollectionId, TokenId};
use sp_runtime::BuildStorage;

Expand Down
2 changes: 2 additions & 0 deletions pallets/nft-migration/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ fn migrating_single_token_should_work() {
ExtBuilder::default().build().execute_with(|| {
init_test_class(RuntimeOrigin::signed(ALICE));
let token_id = Nft::get_next_token_id(CLASS_ID);
assert_eq!(Nft::get_total_issuance(CLASS_ID), Ok(0));
assert_ok!(NftMigration::migrate_token_unsigned(
RuntimeOrigin::none(),
ALICE,
Expand All @@ -166,6 +167,7 @@ fn migrating_single_token_should_work() {
assert_eq!(Nft::get_next_token_id(CLASS_ID), token_id + 1);
assert_eq!(Nft::get_nft_detail((CLASS_ID, token_id)), Ok(get_test_token_data()));
assert_eq!(Nft::check_ownership(&ALICE, &(CLASS_ID, token_id)), Ok(true));
assert_eq!(Nft::get_total_issuance(CLASS_ID), Ok(1));
});
}

Expand Down

0 comments on commit 398238e

Please sign in to comment.