Skip to content

Commit

Permalink
Add interim type aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
Olshansk committed Sep 14, 2022
1 parent 0caf645 commit 83009d6
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions codec/types/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ func TestAnyPackUnpack(t *testing.T) {
require.Equal(t, spot, animal)
}

// TODO(#13279): Remove this alias in a future release
type TestI ITest

type ITest interface {
DoSomething()
}
Expand Down
9 changes: 9 additions & 0 deletions testutil/testdata/animal.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ func (m HasAnimal) UnpackInterfaces(unpacker types.AnyUnpacker) error {
return unpacker.UnpackAny(m.Animal, &animal)
}

// TODO(#13279): Remove this alias in a future release
type HasAnimalI IHasAnimal

type IHasAnimal interface {
TheAnimal() Animal
}
Expand All @@ -52,6 +55,9 @@ func (m HasAnimal) TheAnimal() Animal {
return m.Animal.GetCachedValue().(Animal)
}

// TODO(#13279): Remove this alias in a future release
type HasHasAnimalI IHasHasAnimal

type IHasHasAnimal interface {
TheHasAnimal() IHasAnimal
}
Expand All @@ -69,6 +75,9 @@ func (m HasHasAnimal) UnpackInterfaces(unpacker types.AnyUnpacker) error {
return unpacker.UnpackAny(m.HasAnimal, &animal)
}

// TODO(#13279): Remove this alias in a future release
type HasHasHasAnimalI IHasHasHasAnimal

type IHasHasHasAnimal interface {
TheHasHasAnimal() IHasHasAnimal
}
Expand Down
3 changes: 3 additions & 0 deletions x/auth/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/types"
)

// TODO(#13279): Remove this alias in a future release
type AccountKeeperI IAccountKeeper

// IAccountKeeper is the interface contract that x/auth's keeper implements.
type IAccountKeeper interface {
// Return a new account with the next account number and the specified address. Does not save the new account to the store.
Expand Down
6 changes: 6 additions & 0 deletions x/auth/types/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ func (ma *ModuleAccount) UnmarshalJSON(bz []byte) error {
return nil
}

// TODO(#13279): Remove this alias in a future release
type AccountI IAccount

// IAccount is an interface used to store coins at a given address within state.
// It presumes a notion of sequence numbers for replay protection,
// a notion of account numbers for replay protection for previously pruned accounts,
Expand All @@ -324,6 +327,9 @@ type IAccount interface {
String() string
}

// TODO(#13279): Remove this alias in a future release
type ModuleAccountI IModuleAccount

// IModuleAccount defines an account interface for modules that hold tokens in
// an escrow.
type IModuleAccount interface {
Expand Down
3 changes: 3 additions & 0 deletions x/bank/migrations/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func AddressFromBalancesStore(key []byte) sdk.AccAddress {
return sdk.AccAddress(addr)
}

// TODO(#13279): Remove this alias in a future release
type SupplyI ISupply

// ISupply defines an inflationary supply interface for modules that handle
// token supply.
// It is copy-pasted from:
Expand Down
3 changes: 3 additions & 0 deletions x/evidence/exported/evidence.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ type ValidatorEvidence interface {
GetTotalPower() int64
}

// TODO(#13279): Remove this alias in a future release
type MsgSubmitEvidenceI IMsgSubmitEvidence

// IMsgSubmitEvidence defines the specific interface a concrete message must
// implement in order to process submitted evidence. The concrete MsgSubmitEvidence
// must be defined at the application-level.
Expand Down
3 changes: 3 additions & 0 deletions x/feegrant/fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

// TODO(#13279): Remove this alias in a future release
type FeeAllowanceI IFeeAllowance

// FeeAllowance implementations are tied to a given fee delegator and delegatee,
// and are used to enforce fee grant limits.
type IFeeAllowance interface {
Expand Down
6 changes: 6 additions & 0 deletions x/staking/types/exported.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

// TODO(#13279): Remove this alias in a future release
type DelegationI IDelegation

// IDelegation delegation bond for a delegated proof of stake system
type IDelegation interface {
GetDelegatorAddr() sdk.AccAddress // delegator sdk.AccAddress for the bond
GetValidatorAddr() sdk.ValAddress // validator operator address
GetShares() math.LegacyDec // amount of validator's shares held in this delegation
}

// TODO(#13279): Remove this alias in a future release
type ValidatorI IValidator

// IValidator expected validator functions
type IValidator interface {
IsJailed() bool // whether the validator is jailed
Expand Down

0 comments on commit 83009d6

Please sign in to comment.