This commit is contained in:
aozhiwei 2024-09-23 13:42:52 +08:00
parent aba30d617a
commit 6d531f822f

View File

@ -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
}