Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 committed Feb 27, 2024
1 parent eb53ff0 commit d0f56c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion proto/lbm/collection/v1/collection.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "cosmos_proto/cosmos.proto";

// Params defines the parameters for the collection module.
message Params {

Check failure on line 12 in proto/lbm/collection/v1/collection.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present field "1" with name "depth_limit" on message "Params" was deleted.

Check failure on line 12 in proto/lbm/collection/v1/collection.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present field "2" with name "width_limit" on message "Params" was deleted.
reserved 1 to 2;
reserved 1 to 2; // depth_limit, width_limit
}

// Contract defines the information of the contract for the collection.
Expand Down
4 changes: 2 additions & 2 deletions proto/lbm/collection/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ message GenesisState {
// nfts is an array containing the nfts.
repeated ContractNFTs nfts = 7 [(gogoproto.nullable) = false];

reserved 8;
reserved 8; // parents

// grants defines the grant information.
repeated ContractGrants grants = 9 [(gogoproto.nullable) = false];
Expand Down Expand Up @@ -125,7 +125,7 @@ message NextClassIDs {
// contract id associated with the contract.
string contract_id = 1;

reserved 2;
reserved 2; // fungible

// id for the non-fungible tokens.
string non_fungible = 3 [
Expand Down
8 changes: 4 additions & 4 deletions x/collection/keeper/migrations/v3/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func migrateClassStateAndRemoveLegacyState(collectionStore, oldStore storetypes.
newClassStore.Set(idKey(id), []byte{})
oldStore.Delete(idKey(id))

detachNFT(collectionStore, cdc, id)
detachNFTs(collectionStore, cdc, id)
removeFTs(collectionStore, cdc, id)
}

Expand All @@ -57,7 +57,7 @@ func migrateClassStateAndRemoveLegacyState(collectionStore, oldStore storetypes.
return nil
}

func detachNFT(store storetypes.KVStore, cdc codec.BinaryCodec, id string) {
func detachNFTs(store storetypes.KVStore, cdc codec.BinaryCodec, id string) {
iterator := storetypes.KVStorePrefixIterator(store, parentKeyPrefixByContractID(id))
defer iterator.Close()

Expand All @@ -69,7 +69,7 @@ func detachNFT(store storetypes.KVStore, cdc codec.BinaryCodec, id string) {

var parentID gogotypes.StringValue
cdc.MustUnmarshal(iterator.Value(), &parentID)
addCoin(store, id, getRootOwner(store, cdc, contractID, tokenID), collection.NewCoin(tokenID, cmath.OneInt()))
addCoin(store, id, getRootOwner(store, cdc, contractID, parentID.Value), collection.NewCoin(tokenID, cmath.OneInt()))

store.Delete(parentKey(contractID, tokenID))
store.Delete(childKey(contractID, parentID.Value, tokenID))
Expand Down Expand Up @@ -119,7 +119,7 @@ func removeFTBalances(store storetypes.KVStore, contractID, ftID string) {
for ; iterator.Valid(); iterator.Next() {
id, address, tokenID := splitBalanceKey(iterator.Key())
if id != contractID {
panic(fmt.Sprintf("v3 migration: inconsistent ContractID, got: %s, expeted: %s", id, contractID))
panic(fmt.Sprintf("v3 migration: inconsistent ContractID, got: %s, expected: %s", id, contractID))
}

if tokenID == ftID {
Expand Down

0 comments on commit d0f56c5

Please sign in to comment.