0g-chain/x/bep3/abci.go
Kevin Davis 8001cbbfd7
Update asset supply when params change (#604)
* fix: check asset supply

* update begin blocker

* add activation height and tests

* fix: verify outgoing swap recipient

* validate recipient address for outgoing swaps

* update activation time

* remove unused files

Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
2020-06-29 17:38:26 -04:00

16 lines
429 B
Go

package bep3
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// BeginBlocker on every block expires outdated atomic swaps and removes closed
// swap from long term storage (default storage time of 1 week)
func BeginBlocker(ctx sdk.Context, k Keeper) {
k.UpdateExpiredAtomicSwaps(ctx)
k.DeleteClosedAtomicSwapsFromLongtermStorage(ctx)
if ctx.BlockTime().After(SupplyLimitUpgradeTime) {
k.UpdateAssetSupplies(ctx)
}
}