Parsing for block and tx
This commit is contained in:
@ -11,8 +11,11 @@ import (
|
||||
// Op codes
|
||||
var OpCodes = map[string]string{
|
||||
"STOP": "0",
|
||||
"PSH": "30", // 0x30
|
||||
/*
|
||||
"PUSH": "48", // 0x30
|
||||
"POP": "49", // 0x31
|
||||
"LOAD": "54", // 0x36
|
||||
|
||||
/* OLD VM OPCODES
|
||||
"ADD": "16", // 0x10
|
||||
"SUB": "17", // 0x11
|
||||
"MUL": "18", // 0x12
|
||||
@ -57,7 +60,7 @@ var OpCodes = map[string]string{
|
||||
func CompileInstr(s string) (string, error) {
|
||||
tokens := strings.Split(s, " ")
|
||||
if OpCodes[tokens[0]] == "" {
|
||||
return "", errors.New(fmt.Sprintf("OP not found: %s", tokens[0]))
|
||||
return s, errors.New(fmt.Sprintf("OP not found: %s", tokens[0]))
|
||||
}
|
||||
|
||||
code := OpCodes[tokens[0]] // Replace op codes with the proper numerical equivalent
|
||||
|
Reference in New Issue
Block a user