Skip to content

Commit

Permalink
wallet: misc doc updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
nodech committed Nov 29, 2022
1 parent 329c026 commit 137534e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
18 changes: 10 additions & 8 deletions lib/wallet/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,26 +309,28 @@ class Account extends bio.Struct {

/**
* Create a new receiving address (increments receiveDepth).
* @returns {WalletKey}
* @param {Batch} b
* @returns {Promise<WalletKey>}
*/

createReceive() {
return this.createKey(0);
createReceive(b) {
return this.createKey(b, 0);
}

/**
* Create a new change address (increments changeDepth).
* @returns {WalletKey}
* @param {Batch} b
* @returns {Promise<WalletKey>}
*/

createChange() {
return this.createKey(1);
createChange(b) {
return this.createKey(b, 1);
}

/**
* Create a new address (increments depth).
* @param {Boolean} change
* @returns {Promise} - Returns {@link WalletKey}.
* @returns {Promise<WalletKey>}
*/

async createKey(b, branch) {
Expand Down Expand Up @@ -511,7 +513,7 @@ class Account extends bio.Struct {

/**
* Allocate new lookahead addresses if necessary.
* @param {Number} receiveDepth
* @param {Number} recawait eiveDepth
* @param {Number} changeDepth
* @returns {Promise} - Returns {@link WalletKey}.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/wallet/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ exports.wdb = {
* C[account][hash][index] -> dummy (coin by account)
* b[height] -> block record
* A[nameHash] -> Name State
* U[hash] -> Nme Undo
* U[hash] -> Name Undo
* i[nameHash][hash][index] -> BlindBid record
* B[nameHash][hash][index] -> BidReveal record
* v[blindHash] -> BlindValue record
Expand Down
16 changes: 9 additions & 7 deletions lib/wallet/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,8 @@ class Wallet extends EventEmitter {

/**
* Create a new receiving address (increments receiveDepth).
* @param {(Number|String)?} acct
* @returns {Promise} - Returns {@link WalletKey}.
* @param {(Number|String)} [acct = 0]
* @returns {Promise<WalletKey>}
*/

createReceive(acct = 0) {
Expand Down Expand Up @@ -2931,7 +2931,7 @@ class Wallet extends EventEmitter {
* @param {String} name
* @param {Address} address
* @param {Object} options
* @returns {MTX}
* @returns {Promise<MTX>}
*/

async _createTransfer(name, address, options) {
Expand All @@ -2947,7 +2947,7 @@ class Wallet extends EventEmitter {
* @param {String} name
* @param {Address} address
* @param {Object} options
* @returns {MTX}
* @returns {Promise<MTX>}
*/

async createTransfer(name, address, options) {
Expand All @@ -2965,6 +2965,7 @@ class Wallet extends EventEmitter {
* @param {String} name
* @param {Address} address
* @param {Object} options
* @returns {Promise<TX>}
*/

async _sendTransfer(name, address, options) {
Expand Down Expand Up @@ -3803,7 +3804,7 @@ class Wallet extends EventEmitter {
* Make a batch transaction with multiple actions.
* @param {Array} actions
* @param {Object} options
* @returns {MTX}
* @returns {Promise<MTX>}
*/

async _createBatch(actions, options) {
Expand Down Expand Up @@ -3885,7 +3886,7 @@ class Wallet extends EventEmitter {
* Finalize and template an MTX.
* @param {MTX} mtx
* @param {Object} options
* @returns {MTX}
* @returns {Promise<MTX>}
*/

async finalize(mtx, options) {
Expand Down Expand Up @@ -3955,6 +3956,7 @@ class Wallet extends EventEmitter {
* Sign and send a (templated) mutable transaction.
* @param {MTX} mtx
* @param {String} passphrase
* @param {Promise<TX>}
*/

async sendMTX(mtx, passphrase) {
Expand Down Expand Up @@ -5005,7 +5007,7 @@ class Wallet extends EventEmitter {
/**
* Get current receive address.
* @param {Number} [acct=0]
* @returns {Address}
* @returns {Promise<Address>}
*/

async receiveAddress(acct = 0) {
Expand Down
4 changes: 2 additions & 2 deletions test/wallet-locked-balance-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1051,12 +1051,12 @@ describe('Wallet Lock Balance', function() {

// NOTE: If the transaction did not contain anything related to the wallet,
// it would be totally missed on revert until rescan.
it.only('should handle missed bid (on confirm)', async () => {
it('should handle missed bid (on confirm)', async () => {
const name = grindName(GRIND_NAME_LEN, chain.tip.height, network);
const wallet = alicew;
const accountName = defaultAcc;
const opts = { account: accountName, hardFee };
let account = await wallet.getAccount(accountName);
const account = await wallet.getAccount(accountName);

const blindAmount = 1e6;
const bidAmount = blindAmount / 4;
Expand Down

0 comments on commit 137534e

Please sign in to comment.