Skip to content

Commit

Permalink
update a .proto file, rebuild protos, continue db changes
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Nov 14, 2023
1 parent 3dd8562 commit e295a63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
13 changes: 8 additions & 5 deletions proto/cosmos/base/store/v1beta1/commit_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ option go_package = "github.com/cosmos/cosmos-sdk/store/types";
// CommitInfo defines commit information used by the multi-store when committing
// a version/height.
message CommitInfo {
int64 version = 1;
repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false];
google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
int64 version = 1;
repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false];
google.protobuf.Timestamp timestamp = 3 [
(gogoproto.nullable) = false,
(gogoproto.stdtime) = true
];
}

// StoreInfo defines store-specific commit information. It contains a reference
// between a store name and the commit ID.
message StoreInfo {
string name = 1;
string name = 1;
CommitID commit_id = 2 [(gogoproto.nullable) = false];
}

Expand All @@ -27,5 +30,5 @@ message CommitID {
option (gogoproto.goproto_stringer) = false;

int64 version = 1;
bytes hash = 2;
bytes hash = 2;
}
2 changes: 1 addition & 1 deletion store/iavl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func LoadStoreWithInitialVersion(db dbm.DB, logger log.Logger, key types.StoreKe
if err != nil {
return nil, err
}

istore.tree.(*immutableTree)

Check failure on line 84 in store/iavl/store.go

View workflow job for this annotation

GitHub Actions / golangci-lint

undeclared name: `istore` (typecheck)
if logger != nil {
logger.Debug("Finished loading IAVL tree")
}
Expand Down
14 changes: 4 additions & 10 deletions store/iavl/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,7 @@ func TestIAVLNoPrune(t *testing.T) {
}

func TestIAVLStoreQuery(t *testing.T) {
db := dbm.NewMemDB()
tree, err := iavl.NewMutableTree(db, cacheSize, false)
require.NoError(t, err)
tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger())

iavlStore := UnsafeNewStore(tree)

Expand Down Expand Up @@ -563,10 +561,8 @@ func TestIAVLStoreQuery(t *testing.T) {

func BenchmarkIAVLIteratorNext(b *testing.B) {
b.ReportAllocs()
db := dbm.NewMemDB()
treeSize := 1000
tree, err := iavl.NewMutableTree(db, cacheSize, false)
require.NoError(b, err)
tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger())

for i := 0; i < treeSize; i++ {
key := randBytes(4)
Expand Down Expand Up @@ -599,8 +595,7 @@ func TestSetInitialVersion(t *testing.T) {
{
"works with a mutable tree",
func(db *dbm.MemDB) *Store {
tree, err := iavl.NewMutableTree(db, cacheSize, false)
require.NoError(t, err)
tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger())
store := UnsafeNewStore(tree)

return store
Expand All @@ -609,8 +604,7 @@ func TestSetInitialVersion(t *testing.T) {
{
"throws error on immutable tree",
func(db *dbm.MemDB) *Store {
tree, err := iavl.NewMutableTree(db, cacheSize, false)
require.NoError(t, err)
tree := iavl.NewMutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger())
store := UnsafeNewStore(tree)
_, version, err := store.tree.SaveVersion()
require.NoError(t, err)
Expand Down

0 comments on commit e295a63

Please sign in to comment.