1
This commit is contained in:
parent
7a9714801b
commit
9982b8bc9a
@ -95,12 +95,22 @@ func (this *vip) RecalcEsCecConvert(accountAddress string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
var lastWithdraw *vesterDepositWithdrawPo
|
||||||
|
allDeposits := []*vesterDepositWithdrawPo{}
|
||||||
for ds.Next() {
|
for ds.Next() {
|
||||||
eventName := ds.GetByName("event_name")
|
p := new(vesterDepositWithdrawPo)
|
||||||
if eventName == constant.VESTER_DEPOSIT_EVENT_NAME {
|
p.eventName = ds.GetByName("event_name")
|
||||||
|
p.chainTimestamp = q5.ToInt32(ds.GetByName("chain_timestamp"))
|
||||||
} else if eventName == constant.VESTER_WITHDRAW_EVENT_NAME {
|
p.accountAddress = ds.GetByName("account_address")
|
||||||
|
p.depositAmount = ds.GetByName("deposit_amount")
|
||||||
|
p.withdrawClamiedAmount = ds.GetByName("withdraw_clamied_amount")
|
||||||
|
p.withdrawBalance = ds.GetByName("withdraw_balance")
|
||||||
|
if p.eventName == constant.VESTER_DEPOSIT_EVENT_NAME {
|
||||||
|
q5.AppendSlice(&allDeposits, p)
|
||||||
|
} else if p.eventName == constant.VESTER_WITHDRAW_EVENT_NAME {
|
||||||
|
if lastWithdraw == nil || lastWithdraw.chainTimestamp < p.chainTimestamp {
|
||||||
|
lastWithdraw = p
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user