Skip to content

Commit

Permalink
Merge branch 'rc/v0.47.0-alpha1' into fix-enum-range
Browse files Browse the repository at this point in the history
  • Loading branch information
0Tech authored Apr 11, 2023
2 parents 94a1404 + 0afcc7d commit b94aa92
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/collection) [\#954](https://github.com/line/lbm-sdk/pull/954) Remove duplicated events in x/collection Msg/Modify
* (x/collection) [\#955](https://github.com/line/lbm-sdk/pull/955) Return nil where the parent not exists in x/collection Query/Parent
* (x/collection) [\#959](https://github.com/line/lbm-sdk/pull/959) Revert #955 and add Query/HasParent into x/collection
* (x/collection) [\#960](https://github.com/line/lbm-sdk/pull/960) Fix default next class ids of x/collection
* (x/collection) [\#961](https://github.com/line/lbm-sdk/pull/961) Do not loop enum in x/collection

### Removed
Expand Down
4 changes: 2 additions & 2 deletions x/collection/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func (x LegacyPermission) String() string {
func DefaultNextClassIDs(contractID string) NextClassIDs {
return NextClassIDs{
ContractId: contractID,
Fungible: sdk.NewUint(0),
NonFungible: sdk.NewUint(1 << 28), // "10000000"
Fungible: sdk.NewUint(1),
NonFungible: sdk.NewUint(1 << 28).Incr(), // "10000000 + 1"
}
}

Expand Down
11 changes: 11 additions & 0 deletions x/collection/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,14 @@ func TestParseCoins(t *testing.T) {
})
}
}

func TestDefaultNextClassIDs(t *testing.T) {
contractID := "deadbeef"
require.Equal(t, collection.NextClassIDs{
ContractId: contractID,
Fungible: sdk.NewUint(1),
NonFungible: sdk.NewUint(1 << 28).Incr(), // "10000000 + 1"
},
collection.DefaultNextClassIDs(contractID),
)
}

0 comments on commit b94aa92

Please sign in to comment.