diff --git a/config.go b/config.go index 7ebd45d90..22f5fdd45 100644 --- a/config.go +++ b/config.go @@ -317,10 +317,10 @@ func parseAndSetDebugLevels(debugLevel string) error { // line options. // // The configuration proceeds as follows: -// 1) Start with a default config with sane settings -// 2) Pre-parse the command line to check for an alternative config file -// 3) Load configuration file overwriting defaults with any specified options -// 4) Parse CLI options and overwrite/add any specified options +// 1. Start with a default config with sane settings +// 2. Pre-parse the command line to check for an alternative config file +// 3. Load configuration file overwriting defaults with any specified options +// 4. Parse CLI options and overwrite/add any specified options // // The above results in dcrwallet functioning properly without any config // settings while still allowing the user to override settings with config files diff --git a/errors/errors.go b/errors/errors.go index e5b1dc7a5..56c4d8385 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -167,18 +167,18 @@ func Errorf(format string, args ...interface{}) error { // args of similar type are passed, the final arg is recorded. The following // types are recognized: // -// errors.Op -// The operation, method, or RPC which was invoked. -// errors.Kind -// The class of error. -// string -// Description of the error condition. String types populate the -// Err field and overwrite, and are overwritten by, other arguments -// which implement the error interface. -// error -// The underlying error. If the error is an *Error, the Op and Kind -// will be promoted to the newly created error if not set to another -// value in the args. +// errors.Op +// The operation, method, or RPC which was invoked. +// errors.Kind +// The class of error. +// string +// Description of the error condition. String types populate the +// Err field and overwrite, and are overwritten by, other arguments +// which implement the error interface. +// error +// The underlying error. If the error is an *Error, the Op and Kind +// will be promoted to the newly created error if not set to another +// value in the args. // // If another *Error is passed as an argument and no other arguments differ from // the wrapped error, instead of wrapping the error, the errors are collapsed diff --git a/internal/rpc/jsonrpc/methods.go b/internal/rpc/jsonrpc/methods.go index c2b76ddfa..88b1630ea 100644 --- a/internal/rpc/jsonrpc/methods.go +++ b/internal/rpc/jsonrpc/methods.go @@ -2918,14 +2918,17 @@ func (s *Server) listLockUnspent(ctx context.Context, icmd interface{}) (interfa // listReceivedByAccount handles a listreceivedbyaccount request by returning // a slice of objects, each one containing: -// "account": the receiving account; -// "amount": total amount received by the account; -// "confirmations": number of confirmations of the most recent transaction. +// +// "account": the receiving account; +// "amount": total amount received by the account; +// "confirmations": number of confirmations of the most recent transaction. +// // It takes two parameters: -// "minconf": minimum number of confirmations to consider a transaction - -// default: one; -// "includeempty": whether or not to include addresses that have no transactions - -// default: false. +// +// "minconf": minimum number of confirmations to consider a transaction - +// default: one; +// "includeempty": whether or not to include addresses that have no transactions - +// default: false. func (s *Server) listReceivedByAccount(ctx context.Context, icmd interface{}) (interface{}, error) { cmd := icmd.(*types.ListReceivedByAccountCmd) w, ok := s.walletLoader.LoadedWallet() @@ -2951,15 +2954,18 @@ func (s *Server) listReceivedByAccount(ctx context.Context, icmd interface{}) (i // listReceivedByAddress handles a listreceivedbyaddress request by returning // a slice of objects, each one containing: -// "account": the account of the receiving address; -// "address": the receiving address; -// "amount": total amount received by the address; -// "confirmations": number of confirmations of the most recent transaction. +// +// "account": the account of the receiving address; +// "address": the receiving address; +// "amount": total amount received by the address; +// "confirmations": number of confirmations of the most recent transaction. +// // It takes two parameters: -// "minconf": minimum number of confirmations to consider a transaction - -// default: one; -// "includeempty": whether or not to include addresses that have no transactions - -// default: false. +// +// "minconf": minimum number of confirmations to consider a transaction - +// default: one; +// "includeempty": whether or not to include addresses that have no transactions - +// default: false. func (s *Server) listReceivedByAddress(ctx context.Context, icmd interface{}) (interface{}, error) { cmd := icmd.(*types.ListReceivedByAddressCmd) w, ok := s.walletLoader.LoadedWallet() diff --git a/internal/rpc/jsonrpc/server.go b/internal/rpc/jsonrpc/server.go index 8b7d03f58..849085a53 100644 --- a/internal/rpc/jsonrpc/server.go +++ b/internal/rpc/jsonrpc/server.go @@ -176,7 +176,7 @@ func NewServer(opts *Options, activeNet *chaincfg.Params, walletLoader *loader.L // httpBasicAuth returns the UTF-8 bytes of the HTTP Basic authentication // string: // -// "Basic " + base64(username + ":" + password) +// "Basic " + base64(username + ":" + password) func httpBasicAuth(username, password string) []byte { const header = "Basic " base64 := base64.StdEncoding diff --git a/internal/rpc/rpcserver/server.go b/internal/rpc/rpcserver/server.go index d69b800fc..712074baf 100644 --- a/internal/rpc/rpcserver/server.go +++ b/internal/rpc/rpcserver/server.go @@ -9,11 +9,11 @@ // Full documentation of the API implemented by this package is maintained in a // language-agnostic document: // -// https://github.com/decred/dcrwallet/blob/master/rpc/documentation/api.md +// https://github.com/decred/dcrwallet/blob/master/rpc/documentation/api.md // // Any API changes must be performed according to the steps listed here: // -// https://github.com/decred/dcrwallet/blob/master/rpc/documentation/serverchanges.md +// https://github.com/decred/dcrwallet/blob/master/rpc/documentation/serverchanges.md package rpcserver import ( diff --git a/rpc/client/dcrd/calls.go b/rpc/client/dcrd/calls.go index 3a980b670..e4cc8377e 100644 --- a/rpc/client/dcrd/calls.go +++ b/rpc/client/dcrd/calls.go @@ -148,11 +148,12 @@ func (r *RPC) ExistsLiveTickets(ctx context.Context, tickets []*chainhash.Hash) // MempoolCount returns the count of a particular kind of transaction in mempool. // Kind may be one of: -// "all" -// "regular" -// "tickets" -// "votes" -// "revocations" +// +// "all" +// "regular" +// "tickets" +// "votes" +// "revocations" func (r *RPC) MempoolCount(ctx context.Context, kind string) (int, error) { const op errors.Op = "dcrd.MempoolCount" // This is rather inefficient, as only the count is needed, not all diff --git a/rpc/jsonrpc/types/doc.go b/rpc/jsonrpc/types/doc.go index dc3d4cdf0..5d283f08e 100644 --- a/rpc/jsonrpc/types/doc.go +++ b/rpc/jsonrpc/types/doc.go @@ -12,39 +12,39 @@ this process. An overview specific to this package is provided here, however it is also instructive to read the documentation for the dcrjson package (https://pkg.go.dev/github.com/decred/dcrd/dcrjson/v4). -Marshalling and Unmarshalling +# Marshalling and Unmarshalling The types in this package map to the required parts of the protocol as discussed in the dcrjson documention - Request Objects (type Request) - - Commands (type Cmd) - - Notifications (type Ntfn) + - Commands (type Cmd) + - Notifications (type Ntfn) - Response Objects (type Response) - - Result (type Result) + - Result (type Result) To simplify the marshalling of the requests and responses, the dcrjson.MarshalCmd and dcrjson.MarshalResponse functions may be used. They return the raw bytes ready to be sent across the wire. Unmarshalling a received Request object is a two step process: - 1) Unmarshal the raw bytes into a Request struct instance via json.Unmarshal - 2) Use UnmarshalCmd on the Result field of the unmarshalled Request to create - a concrete command or notification instance with all struct fields set - accordingly + 1. Unmarshal the raw bytes into a Request struct instance via json.Unmarshal + 2. Use UnmarshalCmd on the Result field of the unmarshalled Request to create + a concrete command or notification instance with all struct fields set + accordingly This approach is used since it provides the caller with access to the additional fields in the request that are not part of the command such as the ID. Unmarshalling a received Response object is also a two step process: - 1) Unmarshal the raw bytes into a Response struct instance via json.Unmarshal - 2) Depending on the ID, unmarshal the Result field of the unmarshalled - Response to create a concrete type instance + 1. Unmarshal the raw bytes into a Response struct instance via json.Unmarshal + 2. Depending on the ID, unmarshal the Result field of the unmarshalled + Response to create a concrete type instance As above, this approach is used since it provides the caller with access to the fields in the response such as the ID and Error. -Command Creation +# Command Creation This package provides two approaches for creating a new command. This first, and preferred, method is to use one of the NewCmd functions. This allows @@ -59,7 +59,7 @@ these checks are, obviously, run-time which means any mistakes won't be found until the code is actually executed. However, it is quite useful for user-supplied commands that are intentionally dynamic. -Help Generation +# Help Generation To facilitate providing consistent help to users of the RPC server, the dcrjson package exposes the GenerateHelp and function which uses reflection on commands diff --git a/rpc/jsonrpc/types/methods.go b/rpc/jsonrpc/types/methods.go index f8b1a7f0d..79a87584a 100644 --- a/rpc/jsonrpc/types/methods.go +++ b/rpc/jsonrpc/types/methods.go @@ -447,7 +447,6 @@ type GetWalletFeeCmd struct{} // NewGetWalletFeeCmd returns a new instance which can be used to issue a // getwalletfee JSON-RPC command. -// func NewGetWalletFeeCmd() *GetWalletFeeCmd { return &GetWalletFeeCmd{} } diff --git a/wallet/doc.go b/wallet/doc.go index 61a42dbb6..b4de6027c 100644 --- a/wallet/doc.go +++ b/wallet/doc.go @@ -6,6 +6,5 @@ /* Package wallet provides ... TODO: Flesh out this section - */ package wallet diff --git a/wallet/drivers/bdb/driver.go b/wallet/drivers/bdb/driver.go index b4d9b4028..01f1fe546 100644 --- a/wallet/drivers/bdb/driver.go +++ b/wallet/drivers/bdb/driver.go @@ -6,11 +6,11 @@ // wallet.OpenDB and wallet.CreateDB functions to be called with the following // arguments: // -// var filename string -// db, err := wallet.CreateDB("bdb", filename) -// if err != nil { /* handle error */ } -// db, err = wallet.OpenDB("bdb", filename) -// if err != nil { /* handle error */ } +// var filename string +// db, err := wallet.CreateDB("bdb", filename) +// if err != nil { /* handle error */ } +// db, err = wallet.OpenDB("bdb", filename) +// if err != nil { /* handle error */ } package bdb import _ "decred.org/dcrwallet/v2/wallet/internal/bdb" // Register bdb driver during init diff --git a/wallet/internal/bdb/doc.go b/wallet/internal/bdb/doc.go index 5c780c149..d1fa7162c 100644 --- a/wallet/internal/bdb/doc.go +++ b/wallet/internal/bdb/doc.go @@ -7,7 +7,7 @@ Package bdb implements an instance of walletdb that uses boltdb for the backing datastore. -Usage +# Usage This package is only a driver to the walletdb package and provides the database type of "bdb". The only parameter the Open and Create functions take is the diff --git a/wallet/txrules/doc.go b/wallet/txrules/doc.go index 80c49bf50..5c5def359 100644 --- a/wallet/txrules/doc.go +++ b/wallet/txrules/doc.go @@ -8,35 +8,34 @@ Package txrules provides functions that are help establish whether or not a transaction abides by non-consensus rules for things like the daemon and stake pool. -Dust and Fee Per KB Calculation +# Dust and Fee Per KB Calculation Please refer to mempool.go in dcrd for more information about the importance of these function. -Pool Fees +# Pool Fees The pool fee is calculated from the percentage given according to the following formula: - ps(v+z) - f = -------------- - s+v + ps(v+z) + f = -------------- + s+v - where f = absolute pool fee as an amount - p = proportion (e.g. 0.5000 = 50.00%) - s = subsidy (adjusted two difficulty periods into the future) - v = price of the ticket - z = the ticket fees + where f = absolute pool fee as an amount + p = proportion (e.g. 0.5000 = 50.00%) + s = subsidy (adjusted two difficulty periods into the future) + v = price of the ticket + z = the ticket fees - This can be derived from the known relation that - ps = (f * (v+z)/(v+s)) obtained from the knowledge - that the outputs of the vote are the amounts - of the stake ticket plus subsidy (v+s) scaled by - the proportional input of the stake pool fee - f/(v+z). + This can be derived from the known relation that + ps = (f * (v+z)/(v+s)) obtained from the knowledge + that the outputs of the vote are the amounts + of the stake ticket plus subsidy (v+s) scaled by + the proportional input of the stake pool fee + f/(v+z). f is then adjusted for the fact that at least one subsidy reduction is likely to occur before it can vote on a block. - */ package txrules diff --git a/wallet/udb/addressmanager.go b/wallet/udb/addressmanager.go index 920d9185e..244fbf987 100644 --- a/wallet/udb/addressmanager.go +++ b/wallet/udb/addressmanager.go @@ -705,7 +705,7 @@ func (m *Manager) CoinTypePrivKey(dbtx walletdb.ReadTx) (*hdkeychain.ExtendedKey // of the same seed in multicurrency wallets. New (not restored) wallets are // now created using the coin types assigned to Decred in SLIP0044: // -// https://github.com/satoshilabs/slips/blob/master/slip-0044.md +// https://github.com/satoshilabs/slips/blob/master/slip-0044.md // // The address manager should be upgraded to the SLIP0044 coin type if it is // currently using the legacy coin type and there are no used accounts or @@ -1434,9 +1434,10 @@ func (m *Manager) LookupAccount(ns walletdb.ReadBucket, name string) (uint32, er // UnlockedWithPassphrase returns nil when the wallet is currently unlocked with a // matching passphrase and errors with the following codes otherwise: -// WatchingOnly: The wallet is watching-only and can never be unlocked -// Locked: The wallet is currently locked -// Passphrase: The wallet is unlocked but the provided passphrase is incorrect +// +// WatchingOnly: The wallet is watching-only and can never be unlocked +// Locked: The wallet is currently locked +// Passphrase: The wallet is unlocked but the provided passphrase is incorrect func (m *Manager) UnlockedWithPassphrase(passphrase []byte) error { defer m.mtx.RUnlock() m.mtx.RLock() @@ -2657,7 +2658,8 @@ func deriveCoinTypeKey(masterNode *hdkeychain.ExtendedKey, coinType uint32) (*hd // hierarchy described by BIP0044 given the master node. // // In particular this is the hierarchical deterministic extended key path: -// m/44'/'/' +// +// m/44'/'/' func deriveAccountKey(coinTypeKey *hdkeychain.ExtendedKey, account uint32) (*hdkeychain.ExtendedKey, error) { // Enforce maximum account number. if account > MaxAccountNum { @@ -2675,7 +2677,8 @@ func deriveAccountKey(coinTypeKey *hdkeychain.ExtendedKey, account uint32) (*hdk // accordingly. // // In particular this is the hierarchical deterministic extended key path: -// m/44'/'/'/ +// +// m/44'/'/'/ // // The branch is 0 for external addresses and 1 for internal addresses. func checkBranchKeys(acctKey *hdkeychain.ExtendedKey) error { diff --git a/wallet/udb/stakedb.go b/wallet/udb/stakedb.go index 12a24410e..650952ecf 100644 --- a/wallet/udb/stakedb.go +++ b/wallet/udb/stakedb.go @@ -66,12 +66,14 @@ var ( // Key names for various database fields. // sstxRecords -// key: sstx tx hash -// val: sstxRecord +// +// key: sstx tx hash +// val: sstxRecord +// // ssgenRecords -// key: sstx tx hash -// val: serialized slice of ssgenRecords // +// key: sstx tx hash +// val: serialized slice of ssgenRecords var ( // Bucket names. sstxRecordsBucketName = []byte("sstxrecords") diff --git a/wallet/udb/txdb.go b/wallet/udb/txdb.go index 8ae82ee11..8359d8a5d 100644 --- a/wallet/udb/txdb.go +++ b/wallet/udb/txdb.go @@ -1001,21 +1001,21 @@ func deleteRawCredit(ns walletdb.ReadWriteBucket, k []byte) error { // // Example usage: // -// prefix := keyTxRecord(txHash, block) -// it := makeCreditIterator(ns, prefix) -// for it.next() { -// // Use it.elem -// // If necessary, read additional details from it.ck, it.cv -// } -// if it.err != nil { -// // Handle error -// } +// prefix := keyTxRecord(txHash, block) +// it := makeCreditIterator(ns, prefix) +// for it.next() { +// // Use it.elem +// // If necessary, read additional details from it.ck, it.cv +// } +// if it.err != nil { +// // Handle error +// } // // The elem's Spent field is not set to true if the credit is spent by an // unmined transaction. To check for this case: // -// k := canonicalOutPoint(&txHash, it.elem.Index) -// it.elem.Spent = existsRawUnminedInput(ns, k) != nil +// k := canonicalOutPoint(&txHash, it.elem.Index) +// it.elem.Spent = existsRawUnminedInput(ns, k) != nil type creditIterator struct { c walletdb.ReadWriteCursor // Set to nil after final iteration dbVersion uint32 @@ -1281,15 +1281,15 @@ func deleteRawDebit(ns walletdb.ReadWriteBucket, k []byte) error { // // Example usage: // -// prefix := keyTxRecord(txHash, block) -// it := makeDebitIterator(ns, prefix) -// for it.next() { -// // Use it.elem -// // If necessary, read additional details from it.ck, it.cv -// } -// if it.err != nil { -// // Handle error -// } +// prefix := keyTxRecord(txHash, block) +// it := makeDebitIterator(ns, prefix) +// for it.next() { +// // Use it.elem +// // If necessary, read additional details from it.ck, it.cv +// } +// if it.err != nil { +// // Handle error +// } type debitIterator struct { c walletdb.ReadWriteCursor // Set to nil after final iteration prefix []byte @@ -1420,30 +1420,29 @@ func deleteUnpublished(ns walletdb.ReadWriteBucket, k []byte) error { // Unmined transaction credits use the canonical serialization format: // -// [0:32] Transaction hash (32 bytes) -// [32:36] Output index (4 bytes) +// [0:32] Transaction hash (32 bytes) +// [32:36] Output index (4 bytes) // // The value matches the format used by mined credits, but the spent flag is // never set and the optional debit record is never included. The simplified // format is thus: // -// [0:8] Amount (8 bytes) -// [8] Flags (1 byte) -// 0x01: Unused -// 0x02: Change -// 0x1c: P2PKH stake flag -// 0x00: None (translates to OP_NOP10) -// 0x04: OP_SSTX -// 0x08: OP_SSGEN -// 0x0c: OP_SSRTX -// 0x10: OP_SSTXCHANGE -// 0x20: IsCoinbase -// 0x40: HasExpiry -// [9] Script type (P2PKH, P2SH, etc) and bit flag for account stored -// [10:14] Byte index (4 bytes, uint32) -// [14:18] Length of script (4 bytes, uint32) -// [18:22] Account (4 bytes, uint32) -// +// [0:8] Amount (8 bytes) +// [8] Flags (1 byte) +// 0x01: Unused +// 0x02: Change +// 0x1c: P2PKH stake flag +// 0x00: None (translates to OP_NOP10) +// 0x04: OP_SSTX +// 0x08: OP_SSGEN +// 0x0c: OP_SSRTX +// 0x10: OP_SSTXCHANGE +// 0x20: IsCoinbase +// 0x40: HasExpiry +// [9] Script type (P2PKH, P2SH, etc) and bit flag for account stored +// [10:14] Byte index (4 bytes, uint32) +// [14:18] Length of script (4 bytes, uint32) +// [18:22] Account (4 bytes, uint32) const ( // unconfCreditKeySize is the total size of an unconfirmed credit // key in bytes. @@ -1576,22 +1575,22 @@ func deleteRawUnminedCredit(ns walletdb.ReadWriteBucket, k []byte) error { // unminedCreditIterator allows for cursor iteration over all credits, in order, // from a single unmined transaction. // -// Example usage: +// Example usage: // -// it := makeUnminedCreditIterator(ns, txHash) -// for it.next() { -// // Use it.elem, it.ck and it.cv -// // Optionally, use it.delete() to remove this k/v pair -// } -// if it.err != nil { -// // Handle error -// } +// it := makeUnminedCreditIterator(ns, txHash) +// for it.next() { +// // Use it.elem, it.ck and it.cv +// // Optionally, use it.delete() to remove this k/v pair +// } +// if it.err != nil { +// // Handle error +// } // // The spentness of the credit is not looked up for performance reasons (because // for unspent credits, it requires another lookup in another bucket). If this // is needed, it may be checked like this: // -// spent := existsRawUnminedInput(ns, it.ck) != nil +// spent := existsRawUnminedInput(ns, it.ck) != nil type unminedCreditIterator struct { c walletdb.ReadWriteCursor dbVersion uint32 @@ -1760,8 +1759,10 @@ func extractRawTicketPickedHeight(v []byte) int32 { // [20] m (in m-of-n) (uint8) // [21] n (in m-of-n) (uint8) // [22] Flags (1 byte) -// [0]: Spent -// [1]: Tree +// +// [0]: Spent +// [1]: Tree +// // [23:55] Block hash (32 byte hash) // [55:59] Block height (uint32) // [59:67] Amount (int64) diff --git a/wallet/udb/txunmined.go b/wallet/udb/txunmined.go index 39308bc08..9bb3edd37 100644 --- a/wallet/udb/txunmined.go +++ b/wallet/udb/txunmined.go @@ -336,10 +336,10 @@ func (s *Store) unminedTxHashes(ns walletdb.ReadBucket) ([]*chainhash.Hash, erro // PruneUnmined removes unmined transactions that no longer belong in the // unmined tx set. This includes: // -// * Any transactions past a set expiry -// * Ticket purchases with a different ticket price than the passed stake +// - Any transactions past a set expiry +// - Ticket purchases with a different ticket price than the passed stake // difficulty -// * Votes that do not vote on the tip block +// - Votes that do not vote on the tip block func (s *Store) PruneUnmined(dbtx walletdb.ReadWriteTx, stakeDiff int64) ([]*chainhash.Hash, error) { ns := dbtx.ReadWriteBucket(wtxmgrBucketKey) diff --git a/wallet/wallet.go b/wallet/wallet.go index 36c3c59bb..f46c21aa7 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -5233,7 +5233,9 @@ func CreateWatchOnly(ctx context.Context, db DB, extendedPubKey string, pubPass // decodeStakePoolColdExtKey decodes the string of stake pool addresses // to search incoming tickets for. The format for the passed string is: -// "xpub...:end" +// +// "xpub...:end" +// // where xpub... is the extended public key and end is the last // address index to scan to, exclusive. Effectively, it returns the derived // addresses for this public key for the address indexes [0,end). The branch diff --git a/wallet/walletdb/doc.go b/wallet/walletdb/doc.go index 51abed8fb..c8d0b6173 100644 --- a/wallet/walletdb/doc.go +++ b/wallet/walletdb/doc.go @@ -25,16 +25,16 @@ the wallet. A quick overview of the features walletdb provides are as follows: - - Key/value store - - Namespace support - - Allows multiple packages to have their own area in the database without - worrying about conflicts - - Read-only and read-write transactions with both manual and managed modes - - Nested buckets - - Supports registration of backend databases - - Comprehensive test coverage + - Key/value store + - Namespace support + - Allows multiple packages to have their own area in the database without + worrying about conflicts + - Read-only and read-write transactions with both manual and managed modes + - Nested buckets + - Supports registration of backend databases + - Comprehensive test coverage -Database +# Database The main entry point is the DB interface. It exposes functionality for creating, retrieving, and removing namespaces. It is obtained via the Create @@ -42,7 +42,7 @@ and Open functions which take a database type string that identifies the specific database driver (backend) to use as well as arguments specific to the specified driver. -Namespaces +# Namespaces The Namespace interface is an abstraction that provides facilities for obtaining transactions (the Tx interface) that are the basis of all database reads and @@ -54,14 +54,14 @@ The Begin function provides an unmanaged transaction while the View and Update functions provide a managed transaction. These are described in more detail below. -Transactions +# Transactions The Tx interface provides facilities for rolling back or committing changes that took place while the transaction was active. It also provides the root bucket under which all keys, values, and nested buckets are stored. A transaction can either be read-only or read-write and managed or unmanaged. -Managed versus Unmanaged Transactions +# Managed versus Unmanaged Transactions A managed transaction is one where the caller provides a function to execute within the context of the transaction and the commit or rollback is handled @@ -74,7 +74,7 @@ call Commit or Rollback when they are finished with it. Leaving transactions open for long periods of time can have several adverse effects, so it is recommended that managed transactions are used instead. -Buckets +# Buckets The Bucket interface provides the ability to manipulate key/value pairs and nested buckets as well as iterate through them. @@ -84,7 +84,7 @@ CreateBucket, CreateBucketIfNotExists, and DeleteBucket functions work with buckets. The ForEach function allows the caller to provide a function to be called with each key/value pair and nested bucket in the current bucket. -Root Bucket +# Root Bucket As discussed above, all of the functions which are used to manipulate key/value pairs and nested buckets exist on the Bucket interface. The root bucket is the @@ -92,7 +92,7 @@ upper-most bucket in a namespace under which data is stored and is created at the same time as the namespace. Use the RootBucket function on the Tx interface to retrieve it. -Nested Buckets +# Nested Buckets The CreateBucket and CreateBucketIfNotExists functions on the Bucket interface provide the ability to create an arbitrary number of nested buckets. It is