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 codeDB dbm.DB
ethTrieDB *ethtrie.Database ethTrieDB *ethtrie.Database
// TODO: Do we need this? // TODO: Do we need this/document?
tracing bool Tracing bool
} }
// NewDatabase returns a reference to an initialized Database type which // 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 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 // TrieDB implements Ethereum's state.Database interface. It returns Ethereum's
// trie.Database low level trie database used for contract state storage. In // 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 // the context of Ethermint, it'll be used to solely store mappings of