From c8c776705909b8b9f1bd6e2c808d5d87dcb9e08b Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 5 Jul 2018 11:05:43 -0400 Subject: [PATCH] Update Ethermint stateDB API --- state/database.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/state/database.go b/state/database.go index e60c31271..b93ae252f 100644 --- a/state/database.go +++ b/state/database.go @@ -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