core: added basic chain configuration
Added chain configuration options and write out during genesis database insertion. If no "config" was found, nothing is written to the database. Configurations are written on a per genesis base. This means that any chain (which is identified by it's genesis hash) can have their own chain settings.
This commit is contained in:
committed by
Jeffrey Wilcke
parent
10d3466c93
commit
f0cbebb19f
@@ -47,7 +47,7 @@ type dummyEnv struct {
|
||||
|
||||
func newDummyEnv(ref *dummyContractRef) *dummyEnv {
|
||||
return &dummyEnv{
|
||||
Env: NewEnv(),
|
||||
Env: NewEnv(true, false),
|
||||
ref: ref,
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ func (d dummyEnv) AddStructLog(StructLog) {}
|
||||
|
||||
func TestStoreCapture(t *testing.T) {
|
||||
var (
|
||||
env = NewEnv()
|
||||
env = NewEnv(true, false)
|
||||
logger = newLogger(LogConfig{Collector: env}, env)
|
||||
mem = NewMemory()
|
||||
stack = newstack()
|
||||
@@ -69,7 +69,7 @@ func TestStoreCapture(t *testing.T) {
|
||||
|
||||
var index common.Hash
|
||||
|
||||
logger.captureState(0, SSTORE, new(big.Int), new(big.Int), mem, stack, contract, nil)
|
||||
logger.captureState(0, SSTORE, new(big.Int), new(big.Int), mem, stack, contract, 0, nil)
|
||||
if len(logger.changedValues[contract.Address()]) == 0 {
|
||||
t.Fatalf("expected exactly 1 changed value on address %x, got %d", contract.Address(), len(logger.changedValues[contract.Address()]))
|
||||
}
|
||||
@@ -91,13 +91,13 @@ func TestStorageCapture(t *testing.T) {
|
||||
stack = newstack()
|
||||
)
|
||||
|
||||
logger.captureState(0, STOP, new(big.Int), new(big.Int), mem, stack, contract, nil)
|
||||
logger.captureState(0, STOP, new(big.Int), new(big.Int), mem, stack, contract, 0, nil)
|
||||
if ref.calledForEach {
|
||||
t.Error("didn't expect for each to be called")
|
||||
}
|
||||
|
||||
logger = newLogger(LogConfig{Collector: env, FullStorage: true}, env)
|
||||
logger.captureState(0, STOP, new(big.Int), new(big.Int), mem, stack, contract, nil)
|
||||
logger.captureState(0, STOP, new(big.Int), new(big.Int), mem, stack, contract, 0, nil)
|
||||
if !ref.calledForEach {
|
||||
t.Error("expected for each to be called")
|
||||
}
|
||||
|
Reference in New Issue
Block a user