mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-25 12:57:17 +00:00
Some minor updates
This commit is contained in:
parent
c642094cac
commit
f21eb88ad1
@ -50,12 +50,16 @@ func ReadConfig(base string) *config {
|
|||||||
|
|
||||||
Config = &config{ExecPath: path, Debug: true, Ver: "0.3.1"}
|
Config = &config{ExecPath: path, Debug: true, Ver: "0.3.1"}
|
||||||
Config.Log = NewLogger(LogFile|LogStd, LogLevelDebug)
|
Config.Log = NewLogger(LogFile|LogStd, LogLevelDebug)
|
||||||
Config.ClientString = fmt.Sprintf("/Ethereum(G) v%s/%s", Config.Ver, runtime.GOOS)
|
Config.SetClientString("/Ethereum(G)")
|
||||||
}
|
}
|
||||||
|
|
||||||
return Config
|
return Config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *config) SetClientString(str string) {
|
||||||
|
Config.ClientString = fmt.Sprintf("%s nv%s/%s", str, c.Ver, runtime.GOOS)
|
||||||
|
}
|
||||||
|
|
||||||
type LoggerType byte
|
type LoggerType byte
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -58,6 +58,10 @@ var OpCodes = map[string]byte{
|
|||||||
"BALANCE": 0x3c,
|
"BALANCE": 0x3c,
|
||||||
"MKTX": 0x3d,
|
"MKTX": 0x3d,
|
||||||
"SUICIDE": 0x3f,
|
"SUICIDE": 0x3f,
|
||||||
|
|
||||||
|
// TODO FIX OPCODES
|
||||||
|
"CALL": 0x40,
|
||||||
|
"RETURN": 0x41,
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsOpCode(s string) bool {
|
func IsOpCode(s string) bool {
|
||||||
@ -76,7 +80,11 @@ func CompileInstr(s string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
num := new(big.Int)
|
num := new(big.Int)
|
||||||
num.SetString(s, 0)
|
_, success := num.SetString(s, 0)
|
||||||
|
// Assume regular bytes during compilation
|
||||||
|
if !success {
|
||||||
|
num.SetBytes([]byte(s))
|
||||||
|
}
|
||||||
|
|
||||||
return num.Bytes(), nil
|
return num.Bytes(), nil
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package ethutil
|
package ethutil
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user