cheatcodes_state.go 673 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
package script

import (
	"errors"
)

func (c *CheatCodesPrecompile) LoadAllocs(pathToAllocsJson string) error {
	c.h.log.Info("loading state", "target", pathToAllocsJson)
	return errors.New("state-loading is not supported")
}

func (c *CheatCodesPrecompile) DumpState(pathToStateJson string) error {
	c.h.log.Info("dumping state", "target", pathToStateJson)

15
	allocs, err := c.h.StateDump()
16
	if err != nil {
17
		return err
18 19 20 21 22 23 24
	}
	// This may be written somewhere in the future (or run some callback to collect the state dump)
	_ = allocs
	c.h.log.Info("state-dumping is not supported, but have state",
		"path", pathToStateJson, "accounts", len(allocs.Accounts))
	return nil
}