more config options

This commit is contained in:
Ethan Buchman
2015-09-25 11:58:11 -04:00
parent 4e6ea7f9f7
commit bb662b8861
7 changed files with 53 additions and 9 deletions
+13
View File
@@ -0,0 +1,13 @@
package vm
import (
cfg "github.com/tendermint/tendermint/config"
)
var config cfg.Config = nil
func init() {
cfg.OnConfig(func(newConfig cfg.Config) {
config = newConfig
})
}
+11 -6
View File
@@ -36,14 +36,19 @@ func (err ErrPermission) Error() string {
return fmt.Sprintf("Contract does not have permission to %s", err.typ)
}
const (
dataStackCapacity = 1024
callStackCapacity = 100 // TODO ensure usage.
memoryCapacity = 1024 * 1024 // 1 MB
)
type Debug bool
const (
dataStackCapacity = 1024
callStackCapacity = 100 // TODO ensure usage.
memoryCapacity = 1024 * 1024 // 1 MB
dbg Debug = true
)
var dbg Debug
func SetDebug(d bool) {
dbg = Debug(d)
}
func (d Debug) Printf(s string, a ...interface{}) {
if d {