Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

emits.gno

0.90 Kb · 36 lines
 1package staker
 2
 3import (
 4	"chain"
 5	"chain/runtime"
 6
 7	"gno.land/p/gnoswap/utils/v1"
 8)
 9
10func emitSetPoolTier(
11	prevAddr string,
12	prevRealm string,
13	poolPath string,
14	tier uint64,
15	rewardPerSecond int64,
16	tierRewards map[uint64]int64,
17	counts [AllTierCount]uint64,
18	currentTime int64,
19) {
20	chain.Emit(
21		"SetPoolTier",
22		"prevAddr", prevAddr,
23		"prevRealm", prevRealm,
24		"poolPath", poolPath,
25		"tier", utils.FormatUint(tier),
26		"rewardPerSecond", utils.FormatInt(rewardPerSecond),
27		"tier1RewardPerSecond", utils.FormatInt(tierRewards[Tier1]),
28		"tier2RewardPerSecond", utils.FormatInt(tierRewards[Tier2]),
29		"tier3RewardPerSecond", utils.FormatInt(tierRewards[Tier3]),
30		"tier1Count", utils.FormatUint(counts[Tier1]),
31		"tier2Count", utils.FormatUint(counts[Tier2]),
32		"tier3Count", utils.FormatUint(counts[Tier3]),
33		"currentTime", utils.FormatInt(currentTime),
34		"currentHeight", utils.FormatInt(runtime.ChainHeight()),
35	)
36}