func NewCommitStateDB(ak auth.AccountKeeper, storageKey sdk.StoreKey) *CommitStateDB {
	return &CommitStateDB{
		ak:                ak,
		storageKey:        storageKey,
		stateObjects:      make(map[string]*stateObject),
		stateObjectsDirty: make(map[string]struct{}),
		logs:              make(map[sdk.Hash][]*Log),
		preimages:         make(map[sdk.Hash][]byte),
		journal:           newJournal(),
	}
}
NewCommitStateDB returns a reference to a newly initialized CommitStateDB
which implements Geth's state.StateDB interface.

CONTRACT: Stores used for state must be cache-wrapped as the ordering of the
key/value space matters in determining the merkle root.
func NewCommitStateDB(ctx sdk.Context, ak auth.AccountKeeper, storageKey, codeKey sdk.StoreKey) *CommitStateDB {
package types
import (
	"encoding/json"
	"fmt"
	"math/big"
	"sort"
	"sync"
	"github.com/tendermint/tendermint/crypto"
	"github.com/Dipper-Labs/Dipper-Protocol/app/v0/auth"
	"github.com/Dipper-Labs/Dipper-Protocol/app/v0/auth/types"
	"github.com/Dipper-Labs/Dipper-Protocol/app/v0/vm/common/math"
	"github.com/Dipper-Labs/Dipper-Protocol/hexutil"
	"github.com/Dipper-Labs/Dipper-Protocol/store/prefix"
	sdk "github.com/Dipper-Labs/Dipper-Protocol/types"
)
var (
	zeroBalance = sdk.ZeroInt().BigInt()
)
type revision struct {
	id           int
	journalIndex int
}
type CommitStateDB struct {
	ctx sdk.Context
	ak auth.AccountKeeper
	storageKey sdk.StoreKey
	stateObjects      map[string]*stateObject
	stateObjectsDirty map[string]struct{}
	refund uint64
	thash, bhash sdk.Hash
	txIndex      int
	logs         map[sdk.Hash][]*Log
	preimages map[sdk.Hash][]byte
	dbErr error
	journal        *journal
	validRevisions []revision
	nextRevisionID int
	lock sync.Mutex
}