-
Notifications
You must be signed in to change notification settings - Fork 602
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
Remove claim module #1301
Remove claim module #1301
Changes from all commits
7a23f4e
2fec5e9
9dbd65a
20b6b87
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,14 @@ import ( | |
"io/ioutil" | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
tmjson "github.com/tendermint/tendermint/libs/json" | ||
tmtypes "github.com/tendermint/tendermint/types" | ||
|
||
appparams "github.com/osmosis-labs/osmosis/v7/app/params" | ||
"github.com/osmosis-labs/osmosis/v7/osmoutils" | ||
claimtypes "github.com/osmosis-labs/osmosis/v7/x/claim/types" | ||
gammtypes "github.com/osmosis-labs/osmosis/v7/x/gamm/types" | ||
lockuptypes "github.com/osmosis-labs/osmosis/v7/x/lockup/types" | ||
"github.com/spf13/cobra" | ||
tmjson "github.com/tendermint/tendermint/libs/json" | ||
tmtypes "github.com/tendermint/tendermint/types" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/server" | ||
|
@@ -40,18 +40,16 @@ type DerivedAccount struct { | |
UnbondingStake sdk.Int `json:"unbonding_stake"` | ||
Bonded sdk.Coins `json:"bonded"` | ||
BondedBySelectPools map[uint64]sdk.Coins `json:"bonded_by_select_pools"` | ||
UnclaimedAirdrop sdk.Coins `json:"unclaimed_airdrop"` | ||
TotalBalances sdk.Coins `json:"total_balances"` | ||
} | ||
|
||
func newDerivedAccount(address string) DerivedAccount { | ||
return DerivedAccount{ | ||
Address: address, | ||
LiquidBalances: sdk.Coins{}, | ||
Staked: sdk.ZeroInt(), | ||
UnbondingStake: sdk.ZeroInt(), | ||
Bonded: sdk.Coins{}, | ||
UnclaimedAirdrop: sdk.Coins{}, | ||
Address: address, | ||
LiquidBalances: sdk.Coins{}, | ||
Staked: sdk.ZeroInt(), | ||
UnbondingStake: sdk.ZeroInt(), | ||
Bonded: sdk.Coins{}, | ||
} | ||
} | ||
|
||
|
@@ -257,34 +255,6 @@ Example: | |
snapshotAccs[address] = acc | ||
} | ||
|
||
claimGenesis := claimtypes.GenesisState{} | ||
clientCtx.Codec.MustUnmarshalJSON(genState["claim"], &claimGenesis) | ||
for _, record := range claimGenesis.ClaimRecords { | ||
address := record.Address | ||
|
||
acc, ok := snapshotAccs[address] | ||
if !ok { | ||
acc = newDerivedAccount(address) | ||
} | ||
|
||
claimablePerAction := sdk.Coins{} | ||
for _, coin := range record.InitialClaimableAmount { | ||
claimablePerAction = claimablePerAction.Add( | ||
sdk.NewCoin(coin.Denom, | ||
coin.Amount.QuoRaw(int64(len(claimtypes.Action_name))), | ||
), | ||
) | ||
} | ||
|
||
for action := range claimtypes.Action_name { | ||
if record.ActionCompleted[action] == false { | ||
acc.UnclaimedAirdrop = acc.UnclaimedAirdrop.Add(claimablePerAction...) | ||
} | ||
} | ||
|
||
snapshotAccs[address] = acc | ||
} | ||
|
||
gammGenesis := gammtypes.GenesisState{} | ||
clientCtx.Codec.MustUnmarshalJSON(genState["gamm"], &gammGenesis) | ||
|
||
|
@@ -313,8 +283,6 @@ Example: | |
Add(sdk.NewCoin(appparams.BaseCoinUnit, account.Staked)). | ||
Add(sdk.NewCoin(appparams.BaseCoinUnit, account.UnbondingStake)). | ||
Add(account.Bonded...). | ||
Add(account.UnclaimedAirdrop...) | ||
snapshotAccs[addr] = account | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh no, this was an error that was missed as well :/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean error? I removed it in the backport branch. Do we need to add it back? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah we needed to still run |
||
} | ||
|
||
snapshot := DeriveSnapshot{ | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this should not have been moved to a history file. We need to undo this