Skip to content

Commit

Permalink
Merge pull request #2 from fetchai/feat/cudos-reinstate-reconciliation
Browse files Browse the repository at this point in the history
feat: Reinstating reconciliation from the PR#375
  • Loading branch information
pbukva authored Sep 6, 2024
2 parents 1a26281 + 0ed8b7f commit 9f32ea8
Show file tree
Hide file tree
Showing 8 changed files with 4,065 additions and 315 deletions.
30 changes: 28 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func New(

app.GovKeeper = *govKeeper.SetHooks(
govtypes.NewMultiGovHooks(
// register the governance hooks
// register the governance hooks
),
)

Expand Down Expand Up @@ -739,6 +739,32 @@ func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) {
panic("Network info not found for chain id: " + ctx.ChainID())
}

err := app.DeleteContractStates(ctx, &networkInfo, manifest)
if err != nil {
return nil, err
}

// Call the separate function to handle the admin upgrade
err = app.UpgradeContractAdmins(ctx, &networkInfo, manifest)
if err != nil {
return nil, err
}

err = app.ProcessReconciliation(ctx, &networkInfo, manifest)
if err != nil {
return nil, err
}

err = app.ChangeContractLabels(ctx, &networkInfo, manifest)
if err != nil {
return nil, err
}

err = app.ChangeContractVersions(ctx, &networkInfo, manifest)
if err != nil {
return nil, err
}

_, genDoc, err := genutiltypes.GenesisStateFromGenFile(app.cudosPath)
if err != nil {
panic(fmt.Errorf("failed to unmarshal genesis state: %w", err))
Expand Down Expand Up @@ -792,7 +818,7 @@ func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) {

err = fundCommunityPool(ctx, app, genesisData, networkInfo, manifest)
if err != nil {
panic(fmt.Errorf("Failed to fund community pool: %w", err))
panic(fmt.Errorf("failed to fund community pool: %w", err))
}

err = VerifySupply(genesisData, networkInfo, manifest)
Expand Down
2 changes: 1 addition & 1 deletion app/ordered_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (om *OrderedMap[K, V]) Set(key K, value V) {
// Set adds a key-value pair to the map - it must not exist before
func (om *OrderedMap[K, V]) SetNew(key K, value V) {
if om.Has(key) {
panic(fmt.Errorf("Key %s already exist", key))
panic(fmt.Errorf("key %v already exist", key))
}
om.Set(key, value)
}
Expand Down
3,402 changes: 3,402 additions & 0 deletions app/reconciliation_data.csv

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions app/reconciliation_data_testnet.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0x0b3777b5Dbea0C579c05898E7160351F114B9E08,0490657da13c62de6495a39958aa864d0a1beff1f4cf65ad1a86c67362b94eb1f35eff0eb1f9ccba919d909707adda21531d286fdff74f9a94f2d63e7979ce26c5,fetch1uvye96zkp86egcwrnsff22ama3c0m8h2aemmsd,,,
0x6ACBEDc7616dA8AB5Cf0bB04fC3aA8CbB2629675,04b049b9a4e0745990f1dd2f95c0940f6ef6e34e6a61735de007faef914698ccdc9d0503cf00558819f744554bfd33895aeada4357b2a6bfb44332b08da8a52c14,fetch1kydzrk0ylc60zt34m00qttev5h3dgz72scl79d,,,
0x3Ffa3598647e93136cf02434629b500E5a40473A,04f40cc694aa1f42b5eaa97ba9500001573f5aa4ef06114837bc972538bf0a67a93d9507472d4562532d9344767bffa20db3034653f34f20958aef135d97afc622,fetch1753h55um54pnskd77x0pfpv3le2e4cdhf3dhqc,,,
Loading

0 comments on commit 9f32ea8

Please sign in to comment.