Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions x/move/keeper/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,15 @@ func (api GoApi) ShareToAmount(valBz []byte, metadata vmtypes.AccountAddress, sh
}

// UnbondTimestamp return staking unbond time
func (api GoApi) UnbondTimestamp() uint64 {
func (api GoApi) UnbondTimestamp() (uint64, error) {
unbondingTime, err := api.StakingKeeper.UnbondingTime(api.ctx)

// TODO - panic to error
if err != nil {
panic(err)
return 0, err
}

sdkCtx := sdk.UnwrapSDKContext(api.ctx)
return uint64(sdkCtx.BlockTime().Unix()) + uint64(unbondingTime.Seconds())
return uint64(sdkCtx.BlockTime().Unix()) + uint64(unbondingTime.Seconds()), nil
}

func (api GoApi) GetPrice(pairId string) ([]byte, uint64, uint64, error) {
Expand Down