Skip to content

Commit

Permalink
update bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cherry-yl-sh committed Jun 17, 2024
1 parent 160da78 commit 47f2d1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions common/price_compoent/price_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func GetPriceUsd(tokenType global_const.TokenType) (float64, error) {
err := Body.Close()
if err != nil {
logrus.Error("close body error: ", err)
return
}
}(res.Body)
body, _ := io.ReadAll(res.Body)
Expand Down
12 changes: 6 additions & 6 deletions schedulor/user_op_event_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ func UserOpEventComunicate(network global_const.Network, event ContractUserOpera
logrus.Debugf("Not Support Network %v", network)
return
}
//if !paymasterAddressSet.Contains(event.Paymaster) {
// logrus.Debugf("UserOpEventComunicate: paymaster not support, %v", event.Paymaster)
// return
//}
if !paymasterAddressSet.Contains(event.Paymaster.String()) {
logrus.Debugf("UserOpEventComunicate: paymaster Address not support, %v", event.Paymaster)
return
}
if !event.Success {
_, err := sponsor_manager.ReleaseUserOpHashLockWhenFail(event.UserOpHash[:], true)
if err != nil {
logrus.Errorf("ReleaseUserOpHashLockWhenFail failed: %v", err)
logrus.Errorf("ReleaseUserOpHashLockWhenFail paymaster:[%s] userOphash:[%s] Sender:[%s] reason: [%v]", event.Paymaster, event.UserOpHash, event.Sender, err)
}
return
}
Expand All @@ -214,7 +214,7 @@ func UserOpEventComunicate(network global_const.Network, event ContractUserOpera
_, err = sponsor_manager.ReleaseBalanceWithActualCost(event.Sender.String(), event.UserOpHash[:], gasCostUsd, true)
if err != nil {
//TODO if is NetWorkError, need retry
logrus.Errorf("ReleaseBalanceWithActualCost failed: %v", err)
logrus.Errorf("ReleaseBalanceWithActualCost paymaster:[%s] userOphash:[%s] Sender:[%s] reason: [%v]", event.Paymaster, event.UserOpHash, event.Sender, err)
return
}
}

0 comments on commit 47f2d1c

Please sign in to comment.