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
6d049fea
Commit
6d049fea
authored
Aug 21, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-chain-ops: bugfixes
parent
1714c430
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
batch_file.go
op-chain-ops/safe/batch_file.go
+9
-13
No files found.
op-chain-ops/safe/batch_file.go
View file @
6d049fea
...
...
@@ -46,14 +46,7 @@ func (b *Batch) AddCall(to common.Address, value *big.Int, sig string, args []an
return
fmt
.
Errorf
(
"%s not found in abi, options are %s"
,
sig
,
methods
)
}
size
:=
0
for
_
,
input
:=
range
method
.
Inputs
{
if
err
:=
countArgs
(
&
size
,
input
);
err
!=
nil
{
return
err
}
}
if
len
(
args
)
!=
len
(
method
.
Inputs
)
&&
len
(
args
)
!=
size
{
if
len
(
args
)
!=
len
(
method
.
Inputs
)
{
return
fmt
.
Errorf
(
"requires %d inputs but got %d for %s"
,
len
(
method
.
Inputs
),
len
(
args
),
method
.
RawName
)
}
...
...
@@ -79,16 +72,19 @@ func (b *Batch) AddCall(to common.Address, value *big.Int, sig string, args []an
inputValues
[
input
.
Name
]
=
str
}
data
,
err
:=
method
.
Inputs
.
PackValues
(
args
)
encoded
,
err
:=
method
.
Inputs
.
PackValues
(
args
)
if
err
!=
nil
{
return
err
}
data
:=
make
([]
byte
,
len
(
method
.
ID
)
+
len
(
encoded
))
copy
(
data
,
method
.
ID
)
copy
(
data
[
len
(
method
.
ID
)
:
],
encoded
)
batchTransaction
:=
BatchTransaction
{
To
:
to
,
Value
:
value
,
Data
:
data
,
Method
:
contractMethod
,
Data
:
data
,
InputValues
:
inputValues
,
}
...
...
@@ -180,8 +176,8 @@ func (b *BatchTransaction) MarshalJSON() ([]byte, error) {
InputValues
:
b
.
InputValues
,
}
if
len
(
b
.
Data
)
!=
0
{
hex
:=
hexutil
.
Encode
(
b
.
Data
)
batch
.
Data
=
&
hex
data
:=
hexutil
.
Bytes
(
b
.
Data
)
batch
.
Data
=
&
data
}
return
json
.
Marshal
(
batch
)
}
...
...
@@ -190,7 +186,7 @@ func (b *BatchTransaction) MarshalJSON() ([]byte, error) {
type
batchTransactionMarshaling
struct
{
To
string
`json:"to"`
Value
uint64
`json:"value,string"`
Data
*
string
`json:"data"`
Data
*
hexutil
.
Bytes
`json:"data"`
Method
ContractMethod
`json:"contractMethod"`
InputValues
map
[
string
]
string
`json:"contractInputsValues"`
}
...
...
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