Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set scope navs in umber upgrade. #2085

Merged
merged 9 commits into from
Jul 19, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Improvements

* Remove the warnings about some config settings [2095](https://github.com/provenance-io/provenance/pull/2095).
* Record several scope NAVs with the umber upgrade [#2085](https://github.com/provenance-io/provenance/pull/2085).

### Dependencies

Expand Down
5 changes: 4 additions & 1 deletion app/scope_navs_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import (
metadatatypes "github.com/provenance-io/provenance/x/metadata/types"
)

const umberTestnetScopeNAVsFN = "upgrade_files/umber/testnet_scope_navs.csv"
const (
umberTestnetScopeNAVsFN = "upgrade_files/umber/testnet_scope_navs.csv"
umberMainnetScopeNAVsFN = "upgrade_files/umber/mainnet_scope_navs.csv"
)

type ScopeNAV struct {
ScopeUUID string
Expand Down
14 changes: 14 additions & 0 deletions app/scope_navs_updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ func TestReadScopeNAVs(t *testing.T) {
Height: 23056719,
},
},
{
fileName: umberMainnetScopeNAVsFN,
expCount: 215558,
expFirst: ScopeNAV{
ScopeUUID: "b0b97639-5ecf-4808-b679-99c11a5cda47",
NetAssetValue: metadatatypes.NewNetAssetValue(sdk.NewInt64Coin(metadatatypes.UsdDenom, 47395000)),
Height: 14871216,
},
expLast: ScopeNAV{
ScopeUUID: "98503480-12be-4142-bd9d-e80c6e017e22",
NetAssetValue: metadatatypes.NewNetAssetValue(sdk.NewInt64Coin(metadatatypes.UsdDenom, 43768160)),
Height: 9787583,
},
},
}

assertEqualEntry := func(t *testing.T, expected, actual ScopeNAV, msg string, args ...interface{}) bool {
Expand Down
Loading
Loading