Skip to content

Commit

Permalink
Set scope navs in umber upgrade. (#2085)
Browse files Browse the repository at this point in the history
* Add a file with the mainnet navs in them and make sure it can be parsed properly.

* In the umber upgrade, set the scope navs using the mainnet data.

* Add changelog entry.

* update scope data

* add tests for new navs csv

* fix files with proper block height for more recent

---------

Co-authored-by: Carlton N Hanna <[email protected]>
  • Loading branch information
SpicyLemon and nullpointer0x00 authored Jul 19, 2024
1 parent 08aff56 commit eb052c3
Show file tree
Hide file tree
Showing 6 changed files with 215,587 additions and 1 deletion.
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

0 comments on commit eb052c3

Please sign in to comment.