Update Ethermint stateDB API

This commit is contained in:
Aleksandr Bezobchuk 2018-07-05 11:05:43 -04:00
parent d01a73218a
commit c8c7767059

View File

@ -43,8 +43,8 @@ type Database struct {
codeDB dbm.DB
ethTrieDB *ethtrie.Database
// TODO: Do we need this?
tracing bool
// TODO: Do we need this/document?
Tracing bool
}
// NewDatabase returns a reference to an initialized Database type which
@ -165,6 +165,12 @@ func (db *Database) ContractCodeSize(addrHash, codeHash ethcommon.Hash) (int, er
return len(db.codeDB.Get(codeHash[:])), nil
}
// Commit commits the underlying Cosmos SDK multi-store returning the commit
// ID.
func (db *Database) Commit() types.CommitID {
return db.stateStore.Commit()
}
// TrieDB implements Ethereum's state.Database interface. It returns Ethereum's
// trie.Database low level trie database used for contract state storage. In
// the context of Ethermint, it'll be used to solely store mappings of