Skip to content

Commit

Permalink
Merge pull request gnolang#3 from ilgooz/ilgooz/wasm-additions
Browse files Browse the repository at this point in the history
chore: switch to `gnolang/goleveldb` and cleanup
  • Loading branch information
moul authored Aug 2, 2023
2 parents f2d6709 + a535c75 commit 0482c08
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 59 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/fortytw2/leaktest v1.3.0
github.com/gdamore/tcell/v2 v2.1.0
github.com/gnolang/cors v1.8.1
github.com/gnolang/goleveldb v0.0.0-20230801134443-a29c535aa920
github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216
github.com/golang/protobuf v1.5.3
github.com/google/gofuzz v1.2.0
Expand All @@ -27,7 +28,6 @@ require (
github.com/peterbourgon/ff/v3 v3.4.0
github.com/pmezard/go-difflib v1.0.0
github.com/stretchr/testify v1.8.4
github.com/syndtr/goleveldb v1.0.0
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c
go.etcd.io/bbolt v1.3.7
go.uber.org/multierr v1.9.0
Expand All @@ -52,7 +52,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/flatbuffers v1.12.1 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/sessions v1.2.1 // indirect
Expand Down
52 changes: 43 additions & 9 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion misc/deployments/staging.gno.land/overlay/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ moniker = "45-79-178-97"
fast_sync = true

# Database backend: goleveldb | cleveldb | boltdb
# * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
# * goleveldb (github.com/gnolang/goleveldb, fork of github.com/syndtr/goleveldb) - most popular implementation)
# - pure go
# - stable
# * cleveldb (uses levigo wrapper)
Expand Down
2 changes: 1 addition & 1 deletion misc/deployments/test2.gno.land/overlay/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ moniker = "45-79-178-97"
fast_sync = true

# Database backend: goleveldb | cleveldb | boltdb
# * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
# * goleveldb (github.com/gnolang/goleveldb - most popular implementation)
# - pure go
# - stable
# * cleveldb (uses levigo wrapper)
Expand Down
2 changes: 1 addition & 1 deletion misc/deployments/test3.gno.land/overlay/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ moniker = "45-79-178-97"
fast_sync = true

# Database backend: goleveldb | cleveldb | boltdb
# * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
# * goleveldb (github.com/gnolang/goleveldb - most popular implementation)
# - pure go
# - stable
# * cleveldb (uses levigo wrapper)
Expand Down
8 changes: 0 additions & 8 deletions tm2/pkg/bft/abci/example/kvstore/os_default.go

This file was deleted.

8 changes: 0 additions & 8 deletions tm2/pkg/bft/abci/example/kvstore/os_wasm.go

This file was deleted.

2 changes: 1 addition & 1 deletion tm2/pkg/bft/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ type BaseConfig struct {
FastSyncMode bool `toml:"fast_sync"`

// Database backend: goleveldb | cleveldb | boltdb
// * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
// * goleveldb (github.com/gnolang/goleveldb - most popular implementation)
// - pure go
// - stable
// * cleveldb (uses levigo wrapper)
Expand Down
2 changes: 1 addition & 1 deletion tm2/pkg/bft/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ moniker = "{{ .BaseConfig.Moniker }}"
fast_sync = {{ .BaseConfig.FastSyncMode }}
# Database backend: goleveldb | cleveldb | boltdb
# * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
# * goleveldb (github.com/gnolang/goleveldb - most popular implementation)
# - pure go
# - stable
# * cleveldb (uses levigo wrapper)
Expand Down
8 changes: 0 additions & 8 deletions tm2/pkg/crypto/keys/os_default.go

This file was deleted.

8 changes: 0 additions & 8 deletions tm2/pkg/crypto/keys/os_wasm.go

This file was deleted.

2 changes: 1 addition & 1 deletion tm2/pkg/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type BackendType string

// These are valid backend types.
const (
// GoLevelDBBackend represents goleveldb (github.com/syndtr/goleveldb - most
// GoLevelDBBackend represents goleveldb (github.com/gnolang/goleveldb - most
// popular implementation)
// - stable
GoLevelDBBackend BackendType = "goleveldb"
Expand Down
15 changes: 6 additions & 9 deletions tm2/pkg/db/go_level_db.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build !wasm && !js
// +build !wasm,!js

package db

import (
Expand All @@ -9,10 +6,10 @@ import (
"fmt"
"path/filepath"

"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/errors"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/gnolang/goleveldb/leveldb"
"github.com/gnolang/goleveldb/leveldb/errors"
"github.com/gnolang/goleveldb/leveldb/iterator"
"github.com/gnolang/goleveldb/leveldb/opt"
)

func init() {
Expand Down Expand Up @@ -292,7 +289,7 @@ func (itr *goLevelDBIterator) Valid() bool {
// Implements Iterator.
func (itr *goLevelDBIterator) Key() []byte {
// Key returns a copy of the current key.
// See https://github.com/syndtr/goleveldb/blob/52c212e6c196a1404ea59592d3f1c227c9f034b2/leveldb/iterator/iter.go#L88
// See https://github.com/gnolang/goleveldb/blob/52c212e6c196a1404ea59592d3f1c227c9f034b2/leveldb/iterator/iter.go#L88
itr.assertNoError()
itr.assertIsValid()
return cp(itr.source.Key())
Expand All @@ -301,7 +298,7 @@ func (itr *goLevelDBIterator) Key() []byte {
// Implements Iterator.
func (itr *goLevelDBIterator) Value() []byte {
// Value returns a copy of the current value.
// See https://github.com/syndtr/goleveldb/blob/52c212e6c196a1404ea59592d3f1c227c9f034b2/leveldb/iterator/iter.go#L88
// See https://github.com/gnolang/goleveldb/blob/52c212e6c196a1404ea59592d3f1c227c9f034b2/leveldb/iterator/iter.go#L88
itr.assertNoError()
itr.assertIsValid()
return cp(itr.source.Value())
Expand Down
2 changes: 1 addition & 1 deletion tm2/pkg/db/go_level_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/gnolang/goleveldb/leveldb/opt"
)

func TestGoLevelDBNewGoLevelDB(t *testing.T) {
Expand Down

0 comments on commit 0482c08

Please sign in to comment.