Merge pull request #704 from gzliudan/fix-sa5001

core, XDCxlending/lendingstate: fix staticcheck warning SA5001
This commit is contained in:
Daniel Liu 2024-10-31 10:37:42 +08:00 committed by GitHub
commit 52dd69ecdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -515,11 +515,11 @@ func Test_CreateOrder(t *testing.T) {
func sendOrder(nonce uint64) {
rpcClient, err := rpc.DialHTTP("http://localhost:8501")
defer rpcClient.Close()
if err != nil {
fmt.Println("rpc.DialHTTP failed", "err", err)
os.Exit(1)
}
defer rpcClient.Close()
rand.Seed(time.Now().UTC().UnixNano())
item := &LendingOrderMsg{
AccountNonce: nonce,

View file

@ -46,10 +46,10 @@ type LendingMsg struct {
func getLendingNonce(userAddress common.Address) (uint64, error) {
rpcClient, err := rpc.DialHTTP("http://127.0.0.1:8501")
defer rpcClient.Close()
if err != nil {
return 0, err
}
defer rpcClient.Close()
var result interface{}
err = rpcClient.Call(&result, "XDCx_getLendingOrderCount", userAddress)
if err != nil {

View file

@ -55,10 +55,10 @@ var (
func getNonce(t *testing.T, userAddress common.Address) (uint64, error) {
rpcClient, err := rpc.DialHTTP("http://127.0.0.1:8501")
defer rpcClient.Close()
if err != nil {
return 0, err
}
defer rpcClient.Close()
var result interface{}
err = rpcClient.Call(&result, "XDCx_getOrderCount", userAddress)
if err != nil {