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
2ab1eb7e
Unverified
Commit
2ab1eb7e
authored
May 03, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mipsevm,cli: step fn fixes, fix lint
parent
9ce6c04a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
run.go
cmd/run.go
+3
-3
state_test.go
mipsevm/state_test.go
+6
-3
No files found.
cmd/run.go
View file @
2ab1eb7e
...
...
@@ -214,9 +214,9 @@ func Run(ctx *cli.Context) error {
proofFmt
:=
ctx
.
String
(
RunProofFmtFlag
.
Name
)
snapshotFmt
:=
ctx
.
String
(
RunSnapshotFmtFlag
.
Name
)
step
:=
us
.
Step
step
Fn
:=
us
.
Step
if
po
.
cmd
!=
nil
{
step
=
Guard
(
po
.
cmd
.
ProcessState
,
step
)
step
Fn
=
Guard
(
po
.
cmd
.
ProcessState
,
stepFn
)
}
for
!
state
.
Exited
{
...
...
@@ -241,7 +241,7 @@ func Run(ctx *cli.Context) error {
if
proofAt
(
state
)
{
preStateHash
:=
crypto
.
Keccak256Hash
(
state
.
EncodeWitness
())
witness
,
err
:=
us
.
Step
(
true
)
witness
,
err
:=
stepFn
(
true
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed at proof-gen step %d (PC: %08x): %w"
,
step
,
state
.
PC
,
err
)
}
...
...
mipsevm/state_test.go
View file @
2ab1eb7e
...
...
@@ -74,7 +74,8 @@ func TestState(t *testing.T) {
if
us
.
state
.
PC
==
endAddr
{
break
}
us
.
Step
(
false
)
_
,
err
:=
us
.
Step
(
false
)
require
.
NoError
(
t
,
err
)
}
require
.
Equal
(
t
,
uint32
(
endAddr
),
us
.
state
.
PC
,
"must reach end"
)
// inspect test result
...
...
@@ -109,7 +110,8 @@ func TestHello(t *testing.T) {
if
us
.
state
.
Exited
{
break
}
us
.
Step
(
false
)
_
,
err
:=
us
.
Step
(
false
)
require
.
NoError
(
t
,
err
)
}
require
.
True
(
t
,
state
.
Exited
,
"must complete program"
)
...
...
@@ -215,7 +217,8 @@ func TestClaim(t *testing.T) {
if
us
.
state
.
Exited
{
break
}
us
.
Step
(
false
)
_
,
err
:=
us
.
Step
(
false
)
require
.
NoError
(
t
,
err
)
}
require
.
True
(
t
,
state
.
Exited
,
"must complete program"
)
...
...
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