mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
* Implement the ewasm module and the EEI. * Add an ewasm standalone binary to test standalone files * use reflection to declare EEI module exports * check the module name when importing EEI functions * make eeiFuncs a function to avoid an init loop issue in call * Add a reference to the ewasm tests * wagon implementation of the Interpreter interface * update to wagon's PR #59 and uses the Process structure * Adapt to endianness change * All tests but 1 passing * CanRun only checks for the header * Add a "debug" module to support "printHex" in contracts Notes: * There are very little checks, e.g. of the call depths and so on.
33 lines
477 B
Go
33 lines
477 B
Go
// Copyright 2017 The go-interpreter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package disasm
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
var (
|
|
logger *log.Logger
|
|
logging bool
|
|
)
|
|
|
|
func SetDebugMode(l bool) {
|
|
w := ioutil.Discard
|
|
logging = l
|
|
|
|
if l {
|
|
w = os.Stderr
|
|
}
|
|
|
|
logger = log.New(w, "", log.Lshortfile)
|
|
logger.SetFlags(log.Lshortfile)
|
|
|
|
}
|
|
|
|
func init() {
|
|
SetDebugMode(false)
|
|
}
|