Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
571b89fb
Unverified
Commit
571b89fb
authored
Oct 23, 2023
by
Adrian Sutton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update stub to support batch calls.
parent
b00a3d12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
faultdisputegame_test.go
op-challenger/game/fault/contracts/faultdisputegame_test.go
+1
-1
stubs.go
op-service/sources/batching/test/stubs.go
+8
-2
No files found.
op-challenger/game/fault/contracts/faultdisputegame_test.go
View file @
571b89fb
...
...
@@ -161,7 +161,7 @@ func setup(t *testing.T) (*test.AbiBasedRpc, *FaultDisputeGameContract) {
address
:=
common
.
HexToAddress
(
"0x24112842371dFC380576ebb09Ae16Cb6B6caD7CB"
)
stubRpc
:=
test
.
NewAbiBasedRpc
(
t
,
fdgAbi
,
address
)
caller
:=
batching
.
NewMultiCaller
(
stubRpc
,
1
)
caller
:=
batching
.
NewMultiCaller
(
stubRpc
,
1
00
)
game
,
err
:=
NewFaultDisputeGameContract
(
address
,
caller
)
require
.
NoError
(
t
,
err
)
return
stubRpc
,
game
...
...
op-service/sources/batching/test/stubs.go
View file @
571b89fb
...
...
@@ -3,6 +3,7 @@ package test
import
(
"context"
"encoding/json"
"errors"
"fmt"
"testing"
...
...
@@ -59,8 +60,13 @@ func (l *AbiBasedRpc) SetResponse(method string, expected []interface{}, output
})
}
func
(
l
*
AbiBasedRpc
)
BatchCallContext
(
_
context
.
Context
,
b
[]
rpc
.
BatchElem
)
error
{
panic
(
"Not implemented"
)
func
(
l
*
AbiBasedRpc
)
BatchCallContext
(
ctx
context
.
Context
,
b
[]
rpc
.
BatchElem
)
error
{
var
errs
[]
error
for
_
,
elem
:=
range
b
{
elem
.
Error
=
l
.
CallContext
(
ctx
,
elem
.
Result
,
elem
.
Method
,
elem
.
Args
...
)
errs
=
append
(
errs
,
elem
.
Error
)
}
return
errors
.
Join
(
errs
...
)
}
func
(
l
*
AbiBasedRpc
)
CallContext
(
_
context
.
Context
,
out
interface
{},
method
string
,
args
...
interface
{})
error
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment