From 4426f2c0219ff3455c400cad246a5f5c89e2b059 Mon Sep 17 00:00:00 2001 From: Idris Hanafi Date: Tue, 27 Jun 2023 18:01:50 -0400 Subject: [PATCH] hotfix: merge errors --- cmd/rpcfuzz/rpcfuzz.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cmd/rpcfuzz/rpcfuzz.go b/cmd/rpcfuzz/rpcfuzz.go index 07ca7420..31e3a65c 100644 --- a/cmd/rpcfuzz/rpcfuzz.go +++ b/cmd/rpcfuzz/rpcfuzz.go @@ -33,7 +33,6 @@ import ( "github.com/xeipuuv/gojsonschema" "math/big" "math/rand" - "os" "regexp" "strings" "sync" @@ -1689,13 +1688,6 @@ func CallRPCAndValidate(ctx context.Context, rpcClient *rpc.Client, currTest RPC } args := currTest.GetArgs() - var result interface{} - err = rpcClient.CallContext(ctx, &result, t.GetMethod(), t.GetArgs()...) - if err != nil && !t.ExpectError() { - log.Error().Err(err).Str("method", t.GetMethod()).Msg("Method test failed") - continue - } - idx := 0 // only one run happening var result interface{} err := rpcClient.CallContext(ctx, &result, currTest.GetMethod(), args...) @@ -1707,7 +1699,7 @@ func CallRPCAndValidate(ctx context.Context, rpcClient *rpc.Client, currTest RPC currTestResult.Errors[idx] = errors.New("Method test failed: " + err.Error()) return currTestResult } - if err == nil && t.ExpectError() { + if err == nil && currTest.ExpectError() { currTestResult.NumberOfTestsFailed++ currTestResult.Errors[idx] = errors.New("Expected an error but didn't get one: " + err.Error()) return currTestResult