mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
rebase vesting
This commit is contained in:
parent
3b35ecfea5
commit
b57b362062
@ -129,7 +129,7 @@ func (k Keeper) UpdateVestedCoinsProgress(ctx sdk.Context, addr sdk.AccAddress,
|
|||||||
vv.VestingPeriodProgress[period][1] = 1
|
vv.VestingPeriodProgress[period][1] = 1
|
||||||
} else {
|
} else {
|
||||||
vv.VestingPeriodProgress[period][1] = 0
|
vv.VestingPeriodProgress[period][1] = 0
|
||||||
notVestedTokens := vv.VestingPeriods[period].VestingAmount
|
notVestedTokens := vv.VestingPeriods[period].Amount
|
||||||
// add the tokens that did not vest to DebtAfterFailedVesting
|
// add the tokens that did not vest to DebtAfterFailedVesting
|
||||||
vv.DebtAfterFailedVesting = vv.DebtAfterFailedVesting.Add(notVestedTokens)
|
vv.DebtAfterFailedVesting = vv.DebtAfterFailedVesting.Add(notVestedTokens)
|
||||||
}
|
}
|
||||||
@ -183,7 +183,7 @@ func (k Keeper) GetPeriodEndTimes(ctx sdk.Context, addr sdk.AccAddress) []int64
|
|||||||
vv := k.GetAccountFromAuthKeeper(ctx, addr)
|
vv := k.GetAccountFromAuthKeeper(ctx, addr)
|
||||||
currentEndTime := vv.StartTime
|
currentEndTime := vv.StartTime
|
||||||
for _, p := range vv.VestingPeriods {
|
for _, p := range vv.VestingPeriods {
|
||||||
currentEndTime += p.PeriodLength
|
currentEndTime += p.Length
|
||||||
endTimes = append(endTimes, currentEndTime)
|
endTimes = append(endTimes, currentEndTime)
|
||||||
}
|
}
|
||||||
return endTimes
|
return endTimes
|
||||||
|
@ -157,10 +157,10 @@ func CreateTestInput(t *testing.T, isCheckTx bool, initPower int64) (sdk.Context
|
|||||||
|
|
||||||
func ValidatorVestingTestAccount() *types.ValidatorVestingAccount {
|
func ValidatorVestingTestAccount() *types.ValidatorVestingAccount {
|
||||||
now := tmtime.Now()
|
now := tmtime.Now()
|
||||||
periods := vesting.VestingPeriods{
|
periods := vesting.Periods{
|
||||||
vesting.VestingPeriod{PeriodLength: int64(12 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
vesting.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vesting.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vesting.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
}
|
}
|
||||||
|
|
||||||
testAddr := types.CreateTestAddrs(1)[0]
|
testAddr := types.CreateTestAddrs(1)[0]
|
||||||
@ -179,10 +179,10 @@ func ValidatorVestingTestAccount() *types.ValidatorVestingAccount {
|
|||||||
|
|
||||||
func ValidatorVestingTestAccounts(numAccounts int) []*types.ValidatorVestingAccount {
|
func ValidatorVestingTestAccounts(numAccounts int) []*types.ValidatorVestingAccount {
|
||||||
now := tmtime.Now()
|
now := tmtime.Now()
|
||||||
periods := vesting.VestingPeriods{
|
periods := vesting.Periods{
|
||||||
vesting.VestingPeriod{PeriodLength: int64(12 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
vesting.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vesting.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vesting.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
}
|
}
|
||||||
testAddr := types.CreateTestAddrs(numAccounts)
|
testAddr := types.CreateTestAddrs(numAccounts)
|
||||||
testPk := types.CreateTestPubKeys(numAccounts)
|
testPk := types.CreateTestPubKeys(numAccounts)
|
||||||
@ -204,10 +204,10 @@ func ValidatorVestingTestAccounts(numAccounts int) []*types.ValidatorVestingAcco
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ValidatorVestingDelegatorTestAccount(startTime time.Time) *types.ValidatorVestingAccount {
|
func ValidatorVestingDelegatorTestAccount(startTime time.Time) *types.ValidatorVestingAccount {
|
||||||
periods := vesting.VestingPeriods{
|
periods := vesting.Periods{
|
||||||
vesting.VestingPeriod{PeriodLength: int64(12 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(stakeDenom, 30000000)}},
|
vesting.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(stakeDenom, 30000000)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(stakeDenom, 15000000)}},
|
vesting.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(stakeDenom, 15000000)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(stakeDenom, 15000000)}},
|
vesting.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(stakeDenom, 15000000)}},
|
||||||
}
|
}
|
||||||
testAddr := types.CreateTestAddrs(1)[0]
|
testAddr := types.CreateTestAddrs(1)[0]
|
||||||
testPk := types.CreateTestPubKeys(1)[0]
|
testPk := types.CreateTestPubKeys(1)[0]
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
|
||||||
authexported "github.com/cosmos/cosmos-sdk/x/auth/exported"
|
authexported "github.com/cosmos/cosmos-sdk/x/auth/exported"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
vestexported "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported"
|
vestexported "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported"
|
||||||
|
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Assert ValidatorVestingAccount implements the vestexported.VestingAccount interface
|
// Assert ValidatorVestingAccount implements the vestexported.VestingAccount interface
|
||||||
@ -20,7 +20,7 @@ var _ authexported.GenesisAccount = (*ValidatorVestingAccount)(nil)
|
|||||||
|
|
||||||
// Register the ValidatorVestingAccount type on the auth module codec
|
// Register the ValidatorVestingAccount type on the auth module codec
|
||||||
func init() {
|
func init() {
|
||||||
auth.RegisterAccountTypeCodec(&ValidatorVestingAccount{}, "cosmos-sdk/ValidatorVestingAccount")
|
authtypes.RegisterAccountTypeCodec(&ValidatorVestingAccount{}, "cosmos-sdk/ValidatorVestingAccount")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidatorVestingAccount implements the VestingAccount interface. It
|
// ValidatorVestingAccount implements the VestingAccount interface. It
|
||||||
@ -31,7 +31,7 @@ func init() {
|
|||||||
// If the validator has not signed at least the threshold percentage of blocks during a period,
|
// If the validator has not signed at least the threshold percentage of blocks during a period,
|
||||||
// the coins are returned to the return address, or burned if the return address is null.
|
// the coins are returned to the return address, or burned if the return address is null.
|
||||||
type ValidatorVestingAccount struct {
|
type ValidatorVestingAccount struct {
|
||||||
*vesting.PeriodicVestingAccount
|
*vestingtypes.PeriodicVestingAccount
|
||||||
ValidatorAddress sdk.ConsAddress `json:"validator_address" yaml:"validator_address"`
|
ValidatorAddress sdk.ConsAddress `json:"validator_address" yaml:"validator_address"`
|
||||||
ReturnAddress sdk.AccAddress `json:"return_address" yaml:"return_address"`
|
ReturnAddress sdk.AccAddress `json:"return_address" yaml:"return_address"`
|
||||||
SigningThreshold int64 `json:"signing_threshold" yaml:"signing_threshold"`
|
SigningThreshold int64 `json:"signing_threshold" yaml:"signing_threshold"`
|
||||||
@ -41,13 +41,13 @@ type ValidatorVestingAccount struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewValidatorVestingAccountRaw creates a new ValidatorVestingAccount object from BaseVestingAccount
|
// NewValidatorVestingAccountRaw creates a new ValidatorVestingAccount object from BaseVestingAccount
|
||||||
func NewValidatorVestingAccountRaw(bva *vesting.BaseVestingAccount,
|
func NewValidatorVestingAccountRaw(bva *vestingtypes.BaseVestingAccount,
|
||||||
startTime int64, periods vesting.VestingPeriods, validatorAddress sdk.ConsAddress, returnAddress sdk.AccAddress, signingThreshold int64) *ValidatorVestingAccount {
|
startTime int64, periods vestingtypes.Periods, validatorAddress sdk.ConsAddress, returnAddress sdk.AccAddress, signingThreshold int64) *ValidatorVestingAccount {
|
||||||
cva := &vesting.ContinuousVestingAccount{
|
cva := &vestingtypes.ContinuousVestingAccount{
|
||||||
StartTime: startTime,
|
StartTime: startTime,
|
||||||
BaseVestingAccount: bva,
|
BaseVestingAccount: bva,
|
||||||
}
|
}
|
||||||
pva := &vesting.PeriodicVestingAccount{
|
pva := &vestingtypes.PeriodicVestingAccount{
|
||||||
ContinuousVestingAccount: cva,
|
ContinuousVestingAccount: cva,
|
||||||
VestingPeriods: periods,
|
VestingPeriods: periods,
|
||||||
}
|
}
|
||||||
@ -68,22 +68,22 @@ func NewValidatorVestingAccountRaw(bva *vesting.BaseVestingAccount,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewValidatorVestingAccount creates a ValidatorVestingAccount object from a BaseAccount
|
// NewValidatorVestingAccount creates a ValidatorVestingAccount object from a BaseAccount
|
||||||
func NewValidatorVestingAccount(baseAcc *auth.BaseAccount, startTime int64, periods vesting.VestingPeriods, validatorAddress sdk.ConsAddress, returnAddress sdk.AccAddress, signingThreshold int64) *ValidatorVestingAccount {
|
func NewValidatorVestingAccount(baseAcc *authtypes.BaseAccount, startTime int64, periods vestingtypes.Periods, validatorAddress sdk.ConsAddress, returnAddress sdk.AccAddress, signingThreshold int64) *ValidatorVestingAccount {
|
||||||
|
|
||||||
endTime := startTime
|
endTime := startTime
|
||||||
for _, p := range periods {
|
for _, p := range periods {
|
||||||
endTime += p.PeriodLength
|
endTime += p.Length
|
||||||
}
|
}
|
||||||
baseVestingAcc := &vesting.BaseVestingAccount{
|
baseVestingAcc := &vestingtypes.BaseVestingAccount{
|
||||||
BaseAccount: baseAcc,
|
BaseAccount: baseAcc,
|
||||||
OriginalVesting: baseAcc.Coins,
|
OriginalVesting: baseAcc.Coins,
|
||||||
EndTime: endTime,
|
EndTime: endTime,
|
||||||
}
|
}
|
||||||
cva := &vesting.ContinuousVestingAccount{
|
cva := &vestingtypes.ContinuousVestingAccount{
|
||||||
StartTime: startTime,
|
StartTime: startTime,
|
||||||
BaseVestingAccount: baseVestingAcc,
|
BaseVestingAccount: baseVestingAcc,
|
||||||
}
|
}
|
||||||
pva := &vesting.PeriodicVestingAccount{
|
pva := &vestingtypes.PeriodicVestingAccount{
|
||||||
ContinuousVestingAccount: cva,
|
ContinuousVestingAccount: cva,
|
||||||
VestingPeriods: periods,
|
VestingPeriods: periods,
|
||||||
}
|
}
|
||||||
@ -115,12 +115,12 @@ func (vva ValidatorVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins
|
|||||||
numberPeriods := len(vva.VestingPeriods)
|
numberPeriods := len(vva.VestingPeriods)
|
||||||
for i := 0; i < numberPeriods; i++ {
|
for i := 0; i < numberPeriods; i++ {
|
||||||
x := blockTime.Unix() - currentPeriodStartTime
|
x := blockTime.Unix() - currentPeriodStartTime
|
||||||
if x >= vva.VestingPeriods[i].PeriodLength {
|
if x >= vva.VestingPeriods[i].Length {
|
||||||
vestingComplete := vva.VestingPeriodProgress[i][0] == 1
|
vestingComplete := vva.VestingPeriodProgress[i][0] == 1
|
||||||
if vestingComplete {
|
if vestingComplete {
|
||||||
vestedCoins = vestedCoins.Add(vva.VestingPeriods[i].VestingAmount)
|
vestedCoins = vestedCoins.Add(vva.VestingPeriods[i].Amount)
|
||||||
}
|
}
|
||||||
currentPeriodStartTime += vva.VestingPeriods[i].PeriodLength
|
currentPeriodStartTime += vva.VestingPeriods[i].Length
|
||||||
} else {
|
} else {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ func (vva ValidatorVestingAccount) GetFailedVestedCoins() sdk.Coins {
|
|||||||
if vva.VestingPeriodProgress[i][0] == 1 {
|
if vva.VestingPeriodProgress[i][0] == 1 {
|
||||||
vestedFailure := vva.VestingPeriodProgress[i][1] == 0
|
vestedFailure := vva.VestingPeriodProgress[i][1] == 0
|
||||||
if vestedFailure {
|
if vestedFailure {
|
||||||
failedVestedCoins = failedVestedCoins.Add(vva.VestingPeriods[i].VestingAmount)
|
failedVestedCoins = failedVestedCoins.Add(vva.VestingPeriods[i].Amount)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
break
|
break
|
||||||
@ -199,7 +199,7 @@ func (vva ValidatorVestingAccount) MarshalYAML() (interface{}, error) {
|
|||||||
DelegatedVesting sdk.Coins
|
DelegatedVesting sdk.Coins
|
||||||
EndTime int64
|
EndTime int64
|
||||||
StartTime int64
|
StartTime int64
|
||||||
VestingPeriods vesting.VestingPeriods
|
VestingPeriods vestingtypes.Periods
|
||||||
ValidatorAddress sdk.ConsAddress
|
ValidatorAddress sdk.ConsAddress
|
||||||
ReturnAddress sdk.AccAddress
|
ReturnAddress sdk.AccAddress
|
||||||
SigningThreshold int64
|
SigningThreshold int64
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||||
authexported "github.com/cosmos/cosmos-sdk/x/auth/exported"
|
authexported "github.com/cosmos/cosmos-sdk/x/auth/exported"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
|
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
|
||||||
|
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -22,10 +23,10 @@ var (
|
|||||||
func TestNewAccount(t *testing.T) {
|
func TestNewAccount(t *testing.T) {
|
||||||
now := tmtime.Now()
|
now := tmtime.Now()
|
||||||
endTime := now.Add(24 * time.Hour).Unix()
|
endTime := now.Add(24 * time.Hour).Unix()
|
||||||
periods := vesting.VestingPeriods{
|
periods := vestingtypes.Periods{
|
||||||
vesting.VestingPeriod{PeriodLength: int64(12 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
vestingtypes.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
}
|
}
|
||||||
|
|
||||||
testAddr := CreateTestAddrs(1)[0]
|
testAddr := CreateTestAddrs(1)[0]
|
||||||
@ -44,10 +45,10 @@ func TestNewAccount(t *testing.T) {
|
|||||||
|
|
||||||
func TestGetVestedCoinsValidatorVestingAcc(t *testing.T) {
|
func TestGetVestedCoinsValidatorVestingAcc(t *testing.T) {
|
||||||
now := tmtime.Now()
|
now := tmtime.Now()
|
||||||
periods := vesting.VestingPeriods{
|
periods := vestingtypes.Periods{
|
||||||
vesting.VestingPeriod{PeriodLength: int64(12 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
vestingtypes.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
}
|
}
|
||||||
|
|
||||||
testAddr := CreateTestAddrs(1)[0]
|
testAddr := CreateTestAddrs(1)[0]
|
||||||
@ -119,10 +120,10 @@ func TestGetVestedCoinsValidatorVestingAcc(t *testing.T) {
|
|||||||
|
|
||||||
func TestGetVestingCoinsValidatorVestingAcc(t *testing.T) {
|
func TestGetVestingCoinsValidatorVestingAcc(t *testing.T) {
|
||||||
now := tmtime.Now()
|
now := tmtime.Now()
|
||||||
periods := vesting.VestingPeriods{
|
periods := vestingtypes.Periods{
|
||||||
vesting.VestingPeriod{PeriodLength: int64(12 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
vestingtypes.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
}
|
}
|
||||||
|
|
||||||
testAddr := CreateTestAddrs(1)[0]
|
testAddr := CreateTestAddrs(1)[0]
|
||||||
@ -191,10 +192,10 @@ func TestGetVestingCoinsValidatorVestingAcc(t *testing.T) {
|
|||||||
|
|
||||||
func TestSpendableCoinsValidatorVestingAccount(t *testing.T) {
|
func TestSpendableCoinsValidatorVestingAccount(t *testing.T) {
|
||||||
now := tmtime.Now()
|
now := tmtime.Now()
|
||||||
periods := vesting.VestingPeriods{
|
periods := vestingtypes.Periods{
|
||||||
vesting.VestingPeriod{PeriodLength: int64(12 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
vestingtypes.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
}
|
}
|
||||||
|
|
||||||
testAddr := CreateTestAddrs(1)[0]
|
testAddr := CreateTestAddrs(1)[0]
|
||||||
@ -238,10 +239,10 @@ func TestSpendableCoinsValidatorVestingAccount(t *testing.T) {
|
|||||||
|
|
||||||
func TestGetFailedVestedCoins(t *testing.T) {
|
func TestGetFailedVestedCoins(t *testing.T) {
|
||||||
now := tmtime.Now()
|
now := tmtime.Now()
|
||||||
periods := vesting.VestingPeriods{
|
periods := vestingtypes.Periods{
|
||||||
vesting.VestingPeriod{PeriodLength: int64(12 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
vestingtypes.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
}
|
}
|
||||||
|
|
||||||
testAddr := CreateTestAddrs(1)[0]
|
testAddr := CreateTestAddrs(1)[0]
|
||||||
@ -268,10 +269,10 @@ func TestGetFailedVestedCoins(t *testing.T) {
|
|||||||
}
|
}
|
||||||
func TestTrackDelegationValidatorVestingAcc(t *testing.T) {
|
func TestTrackDelegationValidatorVestingAcc(t *testing.T) {
|
||||||
now := tmtime.Now()
|
now := tmtime.Now()
|
||||||
periods := vesting.VestingPeriods{
|
periods := vestingtypes.Periods{
|
||||||
vesting.VestingPeriod{PeriodLength: int64(12 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
vestingtypes.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
}
|
}
|
||||||
|
|
||||||
testAddr := CreateTestAddrs(1)[0]
|
testAddr := CreateTestAddrs(1)[0]
|
||||||
@ -327,10 +328,10 @@ func TestTrackDelegationValidatorVestingAcc(t *testing.T) {
|
|||||||
|
|
||||||
func TestTrackUndelegationPeriodicVestingAcc(t *testing.T) {
|
func TestTrackUndelegationPeriodicVestingAcc(t *testing.T) {
|
||||||
now := tmtime.Now()
|
now := tmtime.Now()
|
||||||
periods := vesting.VestingPeriods{
|
periods := vestingtypes.Periods{
|
||||||
vesting.VestingPeriod{PeriodLength: int64(12 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
vestingtypes.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
}
|
}
|
||||||
|
|
||||||
testAddr := CreateTestAddrs(1)[0]
|
testAddr := CreateTestAddrs(1)[0]
|
||||||
@ -391,10 +392,10 @@ func TestTrackUndelegationPeriodicVestingAcc(t *testing.T) {
|
|||||||
|
|
||||||
func TestGenesisAccountValidate(t *testing.T) {
|
func TestGenesisAccountValidate(t *testing.T) {
|
||||||
now := tmtime.Now()
|
now := tmtime.Now()
|
||||||
periods := vesting.VestingPeriods{
|
periods := vestingtypes.Periods{
|
||||||
vesting.VestingPeriod{PeriodLength: int64(12 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
vestingtypes.Period{Length: int64(12 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 500), sdk.NewInt64Coin(stakeDenom, 50)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
vesting.VestingPeriod{PeriodLength: int64(6 * 60 * 60), VestingAmount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
vestingtypes.Period{Length: int64(6 * 60 * 60), Amount: sdk.Coins{sdk.NewInt64Coin(feeDenom, 250), sdk.NewInt64Coin(stakeDenom, 25)}},
|
||||||
}
|
}
|
||||||
|
|
||||||
testAddr := CreateTestAddrs(1)[0]
|
testAddr := CreateTestAddrs(1)[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user