Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
sontrinh16 committed Dec 4, 2024
1 parent 54c8f5c commit a4c8c3e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
11 changes: 1 addition & 10 deletions x/accounts/defaults/lockup/lockup.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ var (
StartTimePrefix = collections.NewPrefix(4)
LockingPeriodsPrefix = collections.NewPrefix(5)
OwnerPrefix = collections.NewPrefix(6)
WithdrawedCoinsPrefix = collections.NewPrefix(7)
UnbondEntriesPrefix = collections.NewPrefix(8)
UnbondEntriesPrefix = collections.NewPrefix(7)
)

var (
Expand All @@ -54,7 +53,6 @@ func newBaseLockup(d accountstd.Dependencies) *BaseLockup {
OriginalLocking: collections.NewMap(d.SchemaBuilder, OriginalLockingPrefix, "original_locking", collections.StringKey, sdk.IntValue),
DelegatedFree: collections.NewMap(d.SchemaBuilder, DelegatedFreePrefix, "delegated_free", collections.StringKey, sdk.IntValue),
DelegatedLocking: collections.NewMap(d.SchemaBuilder, DelegatedLockingPrefix, "delegated_locking", collections.StringKey, sdk.IntValue),
WithdrawedCoins: collections.NewMap(d.SchemaBuilder, WithdrawedCoinsPrefix, "withdrawed_coins", collections.StringKey, sdk.IntValue),
UnbondEntries: collections.NewMap(d.SchemaBuilder, UnbondEntriesPrefix, "unbond_entries", collections.StringKey, codec.CollValue[lockuptypes.UnbondingEntries](d.LegacyStateCodec)),
addressCodec: d.AddressCodec,
headerService: d.Environment.HeaderService,
Expand All @@ -70,7 +68,6 @@ type BaseLockup struct {
OriginalLocking collections.Map[string, math.Int]
DelegatedFree collections.Map[string, math.Int]
DelegatedLocking collections.Map[string, math.Int]
WithdrawedCoins collections.Map[string, math.Int]
// map val address to unbonding entries
UnbondEntries collections.Map[string, lockuptypes.UnbondingEntries]
addressCodec address.Codec
Expand Down Expand Up @@ -99,12 +96,6 @@ func (bva *BaseLockup) Init(ctx context.Context, msg *lockuptypes.MsgInitLockupA
if err != nil {
return nil, err
}

// Set initial value for all locked token
err = bva.WithdrawedCoins.Set(ctx, coin.Denom, math.ZeroInt())
if err != nil {
return nil, err
}
}

bondDenom, err := getStakingDenom(ctx)
Expand Down
6 changes: 0 additions & 6 deletions x/accounts/defaults/lockup/periodic_locking_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ func (pva PeriodicLockingAccount) Init(ctx context.Context, msg *lockuptypes.Msg
if err != nil {
return nil, err
}

// Set initial value for all withdrawed token
err = pva.WithdrawedCoins.Set(ctx, coin.Denom, math.ZeroInt())
if err != nil {
return nil, err
}
}

bondDenom, err := getStakingDenom(ctx)
Expand Down

0 comments on commit a4c8c3e

Please sign in to comment.