Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
75e6406c
Commit
75e6406c
authored
Mar 27, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests
parent
3c3431d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
vm_test.go
ethchain/vm_test.go
+8
-8
No files found.
ethchain/vm_test.go
View file @
75e6406c
...
...
@@ -29,7 +29,7 @@ func TestRun3(t *testing.T) {
"PUSH"
,
"0"
,
"RETURN"
,
})
tx
:=
New
Transaction
(
ContractAddr
,
ethutil
.
Big
(
"100000000000000000000000000000000000000000000000
000"
),
script
)
tx
:=
New
ContractCreationTx
(
ethutil
.
Big
(
"0"
),
ethutil
.
Big
(
"1
000"
),
script
)
addr
:=
tx
.
Hash
()[
12
:
]
contract
:=
MakeContract
(
tx
,
state
)
state
.
UpdateContract
(
contract
)
...
...
@@ -51,7 +51,7 @@ func TestRun3(t *testing.T) {
"PUSH"
,
0
,
"RETURN"
,
)
callerTx
:=
New
Transaction
(
ContractAddr
,
ethutil
.
Big
(
"100000000000000000000000000000000000000000000000
000"
),
callerScript
)
callerTx
:=
New
ContractCreationTx
(
ethutil
.
Big
(
"0"
),
ethutil
.
Big
(
"1
000"
),
callerScript
)
// Contract addr as test address
account
:=
NewAccount
(
ContractAddr
,
big
.
NewInt
(
10000000
))
...
...
@@ -84,20 +84,20 @@ func TestRun4(t *testing.T) {
mutan
.
NewCompiler
()
.
Compile
(
strings
.
NewReader
(
`
a = 1337
c = 1
[0] = 50
d = [0]
store
[0] = 50
d =
store
[0]
`
))
asm
:=
mutan
.
NewCompiler
()
.
Compile
(
strings
.
NewReader
(
`
asm
,
_
:=
mutan
.
NewCompiler
()
.
Compile
(
strings
.
NewReader
(
`
a = 3 + 3
[1000] = a
[1000]
stotre
[1000] = a
store
[1000]
`
))
asm
=
append
(
asm
,
"LOG"
)
fmt
.
Println
(
asm
)
callerScript
:=
ethutil
.
Assemble
(
asm
...
)
callerTx
:=
New
Transaction
(
ContractAddr
,
ethutil
.
Big
(
"100000000000000000000000000000000000000000000000
000"
),
callerScript
)
callerTx
:=
New
ContractCreationTx
(
ethutil
.
Big
(
"0"
),
ethutil
.
Big
(
"1
000"
),
callerScript
)
// Contract addr as test address
account
:=
NewAccount
(
ContractAddr
,
big
.
NewInt
(
10000000
))
...
...
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