Skip to content

Commit

Permalink
Removed unwanted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MissingNO57 committed Oct 16, 2024
1 parent e8b65d2 commit 945683b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (app *App) ExportAppStateAndValidators(
func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
applyAllowedAddrs := false

// check if there is a allowed Address list
// check if there is a allowed address list
if len(jailAllowedAddrs) > 0 {
applyAllowedAddrs = true
}
Expand Down
4 changes: 2 additions & 2 deletions app/upgrade_0_11_4_reconciliation.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (app *App) WithdrawReconciliationBalances(ctx types.Context, networkInfo *N
}

if !app.AccountKeeper.HasAccount(ctx, landingAddr) {
return fmt.Errorf("landing Address does not exist")
return fmt.Errorf("landing address does not exist")
}

transfers := UpgradeReconciliationTransfers{}
Expand Down Expand Up @@ -480,7 +480,7 @@ func (app *App) DeleteContractStates(ctx types.Context, networkInfo *NetworkConf
return nil
}

// getContractData returns the contract Address, info, and states for a given contract Address
// getContractData returns the contract address, info, and states for a given contract address
func (app *App) getContractData(ctx types.Context, contractAddr string) (*types.AccAddress, *types.KVStore, *prefix.Store, error) {
addr, err := types.AccAddressFromBech32(contractAddr)
if err != nil {
Expand Down
20 changes: 11 additions & 9 deletions app/upgrade_cudos.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ const (
PermanentLockedAccount = "/cosmos.vesting.v1beta1.PermanentLockedAccount"
PeriodicVestingAccount = "/cosmos.vesting.v1beta1.PeriodicVestingAccount"

UnbondedStatus = "BOND_STATUS_UNBONDED"
UnbondingStatus = "BOND_STATUS_UNBONDING"
BondedStatus = "BOND_STATUS_BONDED"
UnspecifiedBondStatus = "BOND_STATUS_UNSPECIFIED"
UnbondedStatus = "BOND_STATUS_UNBONDED"
UnbondingStatus = "BOND_STATUS_UNBONDING"
BondedStatus = "BOND_STATUS_BONDED"

// Modules with balance
BondedPoolAccName = "bonded_tokens_pool"
Expand Down Expand Up @@ -247,7 +248,7 @@ func GetAccPrefix(jsonData map[string]interface{}) (string, error) {

prefix, _, err := bech32.DecodeAndConvert(accountInfo.Address)
if err != nil {
lastErr = fmt.Errorf("failed to decode Address %s: %w", accountInfo.Address, err)
lastErr = fmt.Errorf("failed to decode address %s: %w", accountInfo.Address, err)
continue
}

Expand Down Expand Up @@ -432,7 +433,7 @@ func parseGenesisBaseAccount(baseAccData map[string]interface{}, accountInfo *Ac
}
accountInfo.Pubkey = AccPubKey

// Get raw Address
// Get raw address
_, accRawAddr, err := bech32.DecodeAndConvert(accountInfo.Address)

accountInfo.RawAddress = accRawAddr
Expand Down Expand Up @@ -625,6 +626,7 @@ func parseGenesisDelegations(validators *OrderedMap[string, *ValidatorInfo], con
resolvedDelegatorMap.Set(validatorOperatorAddress, resolvedDelegator.Add(delegatorTokens))
delegatedBalanceMap.Set(resolvedDelegatorAddress, resolvedDelegatorMap)
} else {

// Store delegation to delegated map
resolvedDelegatorMap, _ := unbondingDelegatedBalanceMap.GetOrSetDefault(resolvedDelegatorAddress, NewOrderedMap[string, sdk.Int]())
resolvedDelegator, _ := resolvedDelegatorMap.GetOrSetDefault(validatorOperatorAddress, sdk.NewInt(0))
Expand Down Expand Up @@ -1397,12 +1399,12 @@ func resolveIfContractAddress(address string, contracts *OrderedMap[string, *Con
if !exists {
return &address, nil
}
// If the contract has an admin that is not itself, continue with the admin Address.
// If the contract has an admin that is not itself, continue with the admin address.
if len(creatorsMap) == 0 && len(adminsMap) < RecursionDepthLimit && contractInfo.Admin != "" && contractInfo.Admin != address && !adminsMap[contractInfo.Admin] {
adminsMap[contractInfo.Admin] = true
address = contractInfo.Admin
} else if len(creatorsMap) < RecursionDepthLimit && contractInfo.Creator != "" && !creatorsMap[contractInfo.Creator] {
// Otherwise, if the creator is present, continue with the creator Address.
// Otherwise, if the creator is present, continue with the creator address.
creatorsMap[contractInfo.Creator] = true
address = contractInfo.Creator
} else {
Expand Down Expand Up @@ -1432,7 +1434,7 @@ func decodePubKeyFromMap(pubKeyMap map[string]interface{}) (cryptotypes.PubKey,

// Ensure the byte slice is the correct length for a secp256k1 public key
if len(keyBytes) != secp256k1.PubKeySize {
return nil, fmt.Errorf("invalid Pubkey length: got %d, expected %d", len(keyBytes), secp256k1.PubKeySize)
return nil, fmt.Errorf("invalid pubkey length: got %d, expected %d", len(keyBytes), secp256k1.PubKeySize)
}

pubKey := secp256k1.PubKey{
Expand All @@ -1453,7 +1455,7 @@ func decodePubKeyFromMap(pubKeyMap map[string]interface{}) (cryptotypes.PubKey,

// Ensure the byte slice is the correct length for an ed25519 public key
if len(keyBytes) != ed25519.PubKeySize {
return nil, fmt.Errorf("invalid Pubkey length: got %d, expected %d", len(keyBytes), ed25519.PubKeySize)
return nil, fmt.Errorf("invalid pubkey length: got %d, expected %d", len(keyBytes), ed25519.PubKeySize)
}

pubKey := ed25519.PubKey{
Expand Down
2 changes: 1 addition & 1 deletion app/upgrade_cudos_distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ func CalculateDelegationRewards(blockHeight uint64, distributionInfo *Distributi
return rewards, nil
}

// get the delegator withdraw Address, defaulting to the delegator Address
// get the delegator withdraw address, defaulting to the delegator address
func (d DistributionInfo) GetDelegatorWithdrawAddr(delAddr string) string {
b, exists := d.DelegatorWithdrawInfos.Get(delAddr)
if !exists {
Expand Down
14 changes: 7 additions & 7 deletions app/upgrade_v_11_4_network_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,15 @@ func LoadAndVerifyNetworkConfigFromFile(configFilePath string, expectedSha256Hex
}

type CudosMergeConfigJSON struct {
IbcTargetAddr string `json:"ibc_target_addr"` // Cudos Address
IbcTargetAddr string `json:"ibc_target_addr"` // Cudos address
RemainingStakingBalanceAddr string `json:"remaining_staking_balance_addr"` // Cudos account for remaining bonded and not-bonded pool balances
RemainingGravityBalanceAddr string `json:"remaining_gravity_balance_addr"` // Cudos Address
RemainingDistributionBalanceAddr string `json:"remaining_distribution_balance_addr"` // Cudos Address
ContractDestinationFallbackAddr string `json:"contract_destination_fallback_addr"` // Cudos Address
CommunityPoolBalanceDestAddr string `json:"community_pool_balance_dest_addr,omitempty"` // Cudos Address, funds are moved to destination chain community pool if not set
RemainingGravityBalanceAddr string `json:"remaining_gravity_balance_addr"` // Cudos address
RemainingDistributionBalanceAddr string `json:"remaining_distribution_balance_addr"` // Cudos address
ContractDestinationFallbackAddr string `json:"contract_destination_fallback_addr"` // Cudos address
CommunityPoolBalanceDestAddr string `json:"community_pool_balance_dest_addr,omitempty"` // Cudos address, funds are moved to destination chain community pool if not set

CommissionFetchAddr string `json:"commission_fetch_addr"` // Fetch Address for commission
ExtraSupplyFetchAddr string `json:"extra_supply_fetch_addr"` // Fetch Address for extra supply
CommissionFetchAddr string `json:"commission_fetch_addr"` // Fetch address for commission
ExtraSupplyFetchAddr string `json:"extra_supply_fetch_addr"` // Fetch address for extra supply
VestingCollisionDestAddr string `json:"vesting_collision_dest_addr"` // This gets converted to raw Address, so it can be fetch or cudos Address

VestingPeriod int64 `json:"vesting_period"` // Vesting period
Expand Down
2 changes: 1 addition & 1 deletion app/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func VerifyAddressPrefix(addr string, expectedPrefix string) error {
}

if prefix != expectedPrefix {
return fmt.Errorf("invalid Address prefix: expected %s, got %s", expectedPrefix, prefix)
return fmt.Errorf("invalid address prefix: expected %s, got %s", expectedPrefix, prefix)
}

return nil
Expand Down

0 comments on commit 945683b

Please sign in to comment.