-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
walletdb: add sequence methods from bbolt to the main bucket interface #672
Conversation
@@ -68,7 +68,7 @@ func (tx *transaction) ReadWriteBucket(key []byte) walletdb.ReadWriteBucket { | |||
} | |||
|
|||
func (tx *transaction) CreateTopLevelBucket(key []byte) (walletdb.ReadWriteBucket, error) { | |||
boltBucket, err := tx.boltTx.CreateBucket(key) | |||
boltBucket, err := tx.boltTx.CreateBucketIfNotExists(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this change relevant to the pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline that without this change, there isn't a way to conditionally obtain/create a top-level bucket.
30f3682
to
9e103f5
Compare
…ment In this commit, we add the trio of sequence based methods that bbolt ships with to the main bucket interface. We do this in order to easily allow walletdb as is to be slotted into place where bbolt is currently used, without sacrificing any functionality.
In this commit, we update our `go list` command to account for the changes to the output of the command when modules are active. If modules are active, then any packages which are themselves a sub-module won't properly be listed.
In this commit, we add a new package-level function to emulate the existing Batch interface for bbolt. We do this via a new super-set interface which is then checked against in the main implementation of the Batch method.
9e103f5
to
2c6a714
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🗂
In this PR, we add the trio of sequence based methods that
bbolt
ships with to the main bucket interface. We do this in order to easily allow walletdb as is to be slotted into place where bbolt is currently used, without sacrificing any functionality.Along the way we fix some issues with sub-modules that resulted in packges not being tested against the latest set of sub-modules. We also resolve an issue with
goclean.sh
that prevented any packages which were themselves sub-modules from being run.