Skip to content

Commit

Permalink
remove migrations changes
Browse files Browse the repository at this point in the history
  • Loading branch information
samricotta committed May 2, 2024
1 parent af8acc2 commit 0701e66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 104 deletions.
4 changes: 2 additions & 2 deletions docs/build/building-modules/18-decimal-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ These changes require a state migration to update existing decimal values to the
## Why the Change?

* **Enhanced Precision**: `Dec` uses the [apd](https://github.com/cockroachdb/apd) library for arbitrary precision decimals, suitable for accurate financial calculations.
* **Immutable Operations**: `Dec` operations are safer for concurrent use as they do not mutate the original values.
* **Immutable Operations**: `Dec` operations are safer for concurrent use, as they do not mutate the original values.
* **Better Performance**: `Dec` operations are faster and more efficient than `LegacyDec`.`

## Using `Dec` in Modules that haven't used `LegacyDec`

If you are creating a new module or updating an existing module that has not used `LegacyDec`, you can directly use `Dec` without any changes.

As an example we will use `DecCoin` which is a common type used in the Cosmos SDK.
As an example, we will use `DecCoin` which is a common type used in the Cosmos SDK.


```protobuf
Expand Down
3 changes: 2 additions & 1 deletion testutil/collections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func TestDiffCollectionsMigration(t *testing.T) {
key := storetypes.NewKVStoreKey("test")
ctx := testutil.DefaultContext(key, storetypes.NewTransientStoreKey("transient"))

// First try with some invalid hash
err := testutil.DiffCollectionsMigration(
ctx,
key,
Expand All @@ -25,7 +26,7 @@ func TestDiffCollectionsMigration(t *testing.T) {
)
require.Error(t, err)


// Now reset and try with the correct hash
ctx = testutil.DefaultContext(key, storetypes.NewTransientStoreKey("transient"))
err = testutil.DiffCollectionsMigration(
ctx,
Expand Down
101 changes: 0 additions & 101 deletions testutil/math_test.go

This file was deleted.

0 comments on commit 0701e66

Please sign in to comment.