This commit is contained in:
aozhiwei 2024-09-23 16:59:33 +08:00
parent b659201260
commit 85c4ed3088

View File

@ -112,7 +112,7 @@ func (this* vester) saveToDb(ds *f5.DataSet) bool {
p := new(jccommon.VesterDepositPo) p := new(jccommon.VesterDepositPo)
if q5.DecodeJson(returnValues, p) == nil { if q5.DecodeJson(returnValues, p) == nil {
decodeJsonOk = true decodeJsonOk = true
f5.GetGoStyleDb().NewUpsert( err, _, _ := f5.GetGoStyleDb().NewUpsert(
constant.BCEVENT_DB, constant.BCEVENT_DB,
"t_vester_deposit_withdraw", "t_vester_deposit_withdraw",
whereKv, whereKv,
@ -121,12 +121,15 @@ func (this* vester) saveToDb(ds *f5.DataSet) bool {
{"account_address", p.Account}, {"account_address", p.Account},
{"deposit_amount", p.Amount}, {"deposit_amount", p.Amount},
})) }))
if err != nil {
return false
}
} }
} else if eventName == VESTER_WITHDRAW_EVENT_NAME { } else if eventName == VESTER_WITHDRAW_EVENT_NAME {
p := new(jccommon.VesterWithdrawPo) p := new(jccommon.VesterWithdrawPo)
if q5.DecodeJson(returnValues, p) == nil { if q5.DecodeJson(returnValues, p) == nil {
decodeJsonOk = true decodeJsonOk = true
f5.GetGoStyleDb().NewUpsert( err, _, _ := f5.GetGoStyleDb().NewUpsert(
constant.BCEVENT_DB, constant.BCEVENT_DB,
"t_vester_deposit_withdraw", "t_vester_deposit_withdraw",
whereKv, whereKv,
@ -136,6 +139,9 @@ func (this* vester) saveToDb(ds *f5.DataSet) bool {
{"withdraw_clamied_amount", p.ClaimedAmount}, {"withdraw_clamied_amount", p.ClaimedAmount},
{"withdraw_balance", p.Balance}, {"withdraw_balance", p.Balance},
})) }))
if err != nil {
return false
}
} }
} else { } else {
panic(fmt.Sprintf("vester unknow event_name %s", eventName)) panic(fmt.Sprintf("vester unknow event_name %s", eventName))