9
9
"github.com/ethereum/go-ethereum/ethclient"
10
10
"github.com/stretchr/testify/mock"
11
11
"math/big"
12
- clientPkg "razor/client"
13
12
"razor/core"
14
13
"razor/core/types"
15
14
"razor/pkg/bindings"
@@ -121,9 +120,10 @@ func TestCommit(t *testing.T) {
121
120
122
121
func TestHandleCommitState (t * testing.T ) {
123
122
var (
124
- client * ethclient.Client
125
- epoch uint32
126
- seed []byte
123
+ client * ethclient.Client
124
+ epoch uint32
125
+ seed []byte
126
+ commitParams types.CommitParams
127
127
)
128
128
129
129
rogueValue := big .NewInt (1111 )
@@ -234,7 +234,7 @@ func TestHandleCommitState(t *testing.T) {
234
234
utilsMock .On ("GetRogueRandomValue" , mock .Anything ).Return (rogueValue )
235
235
236
236
utils := & UtilsStruct {}
237
- got , err := utils .HandleCommitState (client , epoch , seed , & clientPkg. HttpClient {} , tt .args .rogueData )
237
+ got , err := utils .HandleCommitState (client , epoch , seed , commitParams , tt .args .rogueData )
238
238
if ! reflect .DeepEqual (got , tt .want ) {
239
239
t .Errorf ("Data from HandleCommitState function, got = %v, want = %v" , got , tt .want )
240
240
}
@@ -372,9 +372,10 @@ func TestGetSalt(t *testing.T) {
372
372
373
373
func BenchmarkHandleCommitState (b * testing.B ) {
374
374
var (
375
- client * ethclient.Client
376
- epoch uint32
377
- seed []byte
375
+ client * ethclient.Client
376
+ epoch uint32
377
+ seed []byte
378
+ commitParams types.CommitParams
378
379
)
379
380
380
381
rogueValue := big .NewInt (1111 )
@@ -399,7 +400,7 @@ func BenchmarkHandleCommitState(b *testing.B) {
399
400
utilsMock .On ("GetRogueRandomValue" , mock .Anything ).Return (rogueValue )
400
401
401
402
ut := & UtilsStruct {}
402
- _ , err := ut .HandleCommitState (client , epoch , seed , & clientPkg. HttpClient {} , types.Rogue {IsRogue : false })
403
+ _ , err := ut .HandleCommitState (client , epoch , seed , commitParams , types.Rogue {IsRogue : false })
403
404
if err != nil {
404
405
log .Fatal (err )
405
406
}
0 commit comments