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
5971c820
Commit
5971c820
authored
Feb 24, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated opcodes ... again
parent
1a98bbf1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
53 deletions
+53
-53
parsing.go
ethutil/parsing.go
+51
-51
parsing_test.go
ethutil/parsing_test.go
+2
-2
No files found.
ethutil/parsing.go
View file @
5971c820
...
...
@@ -7,57 +7,57 @@ import (
// Op codes
var
OpCodes
=
map
[
string
]
byte
{
"STOP"
:
0
,
"ADD"
:
1
,
"MUL"
:
2
,
"SUB"
:
3
,
"DIV"
:
4
,
"SDIV"
:
5
,
"MOD"
:
6
,
"SMOD"
:
7
,
"EXP"
:
8
,
"NEG"
:
9
,
"LT"
:
10
,
"LE"
:
11
,
"GT"
:
12
,
"GE"
:
13
,
"EQ"
:
14
,
"NOT"
:
15
,
"MYADDRESS"
:
16
,
"TXSENDER"
:
17
,
"TXVALUE"
:
18
,
"TX
FEE"
:
19
,
"TXDATA
N"
:
20
,
"
TXDATA"
:
21
,
"BLK_
PREVHASH"
:
22
,
"BLK_
COINBASE"
:
23
,
"BLK_
TIMESTAMP"
:
24
,
"BLK_
NUMBER"
:
25
,
"BLK_
DIFFICULTY"
:
26
,
"BASEFEE"
:
27
,
"SHA256"
:
32
,
"RIPEMD160"
:
33
,
"ECMUL"
:
34
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I"
:
0x39
,
"IND"
:
0x3a
,
"EXTRO"
:
0x3b
,
"BALANCE"
:
0x3c
,
"MKTX"
:
0x3d
,
"SUICIDE"
:
0x3f
,
}
func
IsOpCode
(
s
string
)
bool
{
...
...
ethutil/parsing_test.go
View file @
5971c820
package
ethutil
/*
import (
"math"
"testing"
...
...
@@ -19,14 +20,13 @@ func TestCompile(t *testing.T) {
}
func TestValidInstr(t *testing.T) {
/*
op, args, err := Instr("68163")
if err != nil {
t.Error("Error decoding instruction")
}
*/
}
func TestInvalidInstr(t *testing.T) {
}
*/
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