From 6d531f822fc1d692c175ca24247f60ae14aea8d7 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 23 Sep 2024 13:42:52 +0800 Subject: [PATCH] 1 --- server/light_backtask/task/vester.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/server/light_backtask/task/vester.go b/server/light_backtask/task/vester.go index a621f83a..76f4d913 100644 --- a/server/light_backtask/task/vester.go +++ b/server/light_backtask/task/vester.go @@ -17,11 +17,11 @@ Withdraw 所有 通过Vester.sol的remainingEsToken方法获取, 如果要本地计算的话, 那就取每次Deposit事件的时间和amount, 加上先前的转换的余额, 再按total * (now - deposit_time) / (365 * 24 * 2600) */ -type vesterDeposit struct { +type vester struct { } -func (this *vesterDeposit) init() { +func (this *vester) init() { mt.Table.Contract.Traverse(func (ele *mt.Contract) bool { if ele.GetName() == jccommon.CONTRACT_NAME_Vester { go this.process(ele.GetNetId(), ele.GetAddress()) @@ -30,15 +30,15 @@ func (this *vesterDeposit) init() { }) } -func (this *vesterDeposit) unInit() { +func (this *vester) unInit() { } -func (this *vesterDeposit) process(netId int32, contractAddress string) { - key := fmt.Sprintf("vesterDeposit.lastIdx.%d.%s", netId, contractAddress) +func (this *vester) process(netId int32, contractAddress string) { + key := fmt.Sprintf("vester.lastIdx.%d.%s", netId, contractAddress) if dbLastIdxStr, err := jccommon.GetDbParam(constant.BCEVENT_DB, key); err == nil { f5.GetGoStyleDb().IncrementLoad( constant.BCEVENT_DB, - "vesterDeposit." + q5.ToString(netId) + "." + contractAddress, + "vester." + q5.ToString(netId) + "." + contractAddress, "t_blockchain_event", q5.ToInt64(dbLastIdxStr), func (lastIdx int64, maxIdx int64) (string, []string) { @@ -62,10 +62,10 @@ ORDER BY idx LIMIT 1000 }, this.saveToDb) } else { - panic(fmt.Sprintf("vesterDeposit getDBParam error %s", err)) + panic(fmt.Sprintf("vester getDBParam error %s", err)) } } -func (this* vesterDeposit) saveToDb(ds *f5.DataSet) bool { +func (this* vester) saveToDb(ds *f5.DataSet) bool { return true }