Skip to content

Commit bb13a84

Browse files
committed
lint and docs
1 parent c06aedf commit bb13a84

File tree

5 files changed

+44
-44
lines changed

5 files changed

+44
-44
lines changed

docs/client.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,6 +2403,7 @@ export interface ValidCreateActionArgs extends ValidProcessActionArgs {
24032403
labels: string[];
24042404
options: ValidCreateActionOptions;
24052405
isSignAction: boolean;
2406+
randomVals?: number[];
24062407
}
24072408
```
24082409

@@ -3959,7 +3960,7 @@ See also: [StorageProvenOrReq](#interface-storageprovenorreq), [TrxToken](#inter
39593960
#### Method getReqsAndBeefToShareWithWorld
39603961

39613962
Given an array of transaction txids with current ProvenTxReq ready-to-share status,
3962-
lookup their DojoProvenTxReqApi req records.
3963+
lookup their ProvenTxReqApi req records.
39633964
For the txids with reqs and status still ready to send construct a single merged beef.
39643965

39653966
```ts
@@ -3997,12 +3998,6 @@ async updateTransactionStatus(status: sdk.TransactionStatus, transactionId?: num
39973998
```
39983999
See also: [TransactionStatus](#type-transactionstatus), [TrxToken](#interface-trxtoken)
39994000

4000-
Throws
4001-
4002-
ERR_DOJO_COMPLETED_TX if current status is 'completed' and new status is not 'completed.
4003-
4004-
ERR_DOJO_PROVEN_TX if transaction has proof or provenTxId and new status is not 'completed'.
4005-
40064001
</details>
40074002

40084003
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
@@ -4745,6 +4740,7 @@ export class Wallet implements WalletInterface, ProtoWallet {
47454740
proto: ProtoWallet;
47464741
privilegedKeyManager?: sdk.PrivilegedKeyManager;
47474742
pendingSignActions: Record<string, PendingSignAction>;
4743+
randomVals?: number[] = undefined;
47484744
constructor(argsOrSigner: WalletArgs | WalletSigner, services?: sdk.WalletServices, monitor?: Monitor, privilegedKeyManager?: sdk.PrivilegedKeyManager)
47494745
async destroy(): Promise<void>
47504746
getClientChangeKeyPair(): sdk.KeyPair
@@ -4805,6 +4801,14 @@ Over time, this allows an active wallet to drastically reduce the amount of data
48054801
beef: BeefParty
48064802
```
48074803

4804+
#### Property randomVals
4805+
4806+
For repeatability testing, set to an array of random numbers from [0..1).
4807+
4808+
```ts
4809+
randomVals?: number[] = undefined
4810+
```
4811+
48084812
#### Method getKnownTxids
48094813

48104814
```ts
@@ -4879,8 +4883,6 @@ standard HTTP error status object with status property set to 'error'.
48794883

48804884
Recovers all public fields from WalletError derived error classes and relevant Error derived errors.
48814885

4882-
Critical client data fields are preserved across HTTP DojoExpress / DojoExpressClient encoding.
4883-
48844886
```ts
48854887
static fromUnknown(err: unknown): WalletError
48864888
```

docs/storage.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ See also: [StorageProvenOrReq](#interface-storageprovenorreq), [TrxToken](#inter
10101010
#### Method getReqsAndBeefToShareWithWorld
10111011
10121012
Given an array of transaction txids with current ProvenTxReq ready-to-share status,
1013-
lookup their DojoProvenTxReqApi req records.
1013+
lookup their ProvenTxReqApi req records.
10141014
For the txids with reqs and status still ready to send construct a single merged beef.
10151015
10161016
```ts
@@ -1048,12 +1048,6 @@ async updateTransactionStatus(status: sdk.TransactionStatus, transactionId?: num
10481048
```
10491049
See also: [TransactionStatus](#type-transactionstatus), [TrxToken](#interface-trxtoken)
10501050
1051-
Throws
1052-
1053-
ERR_DOJO_COMPLETED_TX if current status is 'completed' and new status is not 'completed.
1054-
1055-
ERR_DOJO_PROVEN_TX if transaction has proof or provenTxId and new status is not 'completed'.
1056-
10571051
</details>
10581052
10591053
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)

docs/wallet.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,6 +2403,7 @@ export interface ValidCreateActionArgs extends ValidProcessActionArgs {
24032403
labels: string[];
24042404
options: ValidCreateActionOptions;
24052405
isSignAction: boolean;
2406+
randomVals?: number[];
24062407
}
24072408
```
24082409

@@ -3959,7 +3960,7 @@ See also: [StorageProvenOrReq](#interface-storageprovenorreq), [TrxToken](#inter
39593960
#### Method getReqsAndBeefToShareWithWorld
39603961

39613962
Given an array of transaction txids with current ProvenTxReq ready-to-share status,
3962-
lookup their DojoProvenTxReqApi req records.
3963+
lookup their ProvenTxReqApi req records.
39633964
For the txids with reqs and status still ready to send construct a single merged beef.
39643965

39653966
```ts
@@ -3997,12 +3998,6 @@ async updateTransactionStatus(status: sdk.TransactionStatus, transactionId?: num
39973998
```
39983999
See also: [TransactionStatus](#type-transactionstatus), [TrxToken](#interface-trxtoken)
39994000

4000-
Throws
4001-
4002-
ERR_DOJO_COMPLETED_TX if current status is 'completed' and new status is not 'completed.
4003-
4004-
ERR_DOJO_PROVEN_TX if transaction has proof or provenTxId and new status is not 'completed'.
4005-
40064001
</details>
40074002

40084003
Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Variables](#variables)
@@ -4745,6 +4740,7 @@ export class Wallet implements WalletInterface, ProtoWallet {
47454740
proto: ProtoWallet;
47464741
privilegedKeyManager?: sdk.PrivilegedKeyManager;
47474742
pendingSignActions: Record<string, PendingSignAction>;
4743+
randomVals?: number[] = undefined;
47484744
constructor(argsOrSigner: WalletArgs | WalletSigner, services?: sdk.WalletServices, monitor?: Monitor, privilegedKeyManager?: sdk.PrivilegedKeyManager)
47494745
async destroy(): Promise<void>
47504746
getClientChangeKeyPair(): sdk.KeyPair
@@ -4805,6 +4801,14 @@ Over time, this allows an active wallet to drastically reduce the amount of data
48054801
beef: BeefParty
48064802
```
48074803

4804+
#### Property randomVals
4805+
4806+
For repeatability testing, set to an array of random numbers from [0..1).
4807+
4808+
```ts
4809+
randomVals?: number[] = undefined
4810+
```
4811+
48084812
#### Method getKnownTxids
48094813

48104814
```ts
@@ -4879,8 +4883,6 @@ standard HTTP error status object with status property set to 'error'.
48794883

48804884
Recovers all public fields from WalletError derived error classes and relevant Error derived errors.
48814885

4882-
Critical client data fields are preserved across HTTP DojoExpress / DojoExpressClient encoding.
4883-
48844886
```ts
48854887
static fromUnknown(err: unknown): WalletError
48864888
```

src/storage/methods/createAction.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -871,13 +871,12 @@ async function fundNewTransactionSdk(
871871
return Math.floor(nextRandomVal() * (max - min + 1) + min)
872872
}
873873

874-
const randomDerivation = (count: number) : string => {
874+
const randomDerivation = (count: number): string => {
875875
let val: number[] = []
876876
if (!vargs.randomVals || vargs.randomVals.length === 0) {
877877
val = Random(count)
878878
} else {
879-
for (let i = 0; i < count; i++)
880-
val.push(rand(0, 255))
879+
for (let i = 0; i < count; i++) val.push(rand(0, 255))
881880
}
882881
return Utils.toBase64(val)
883882
}

test/wallet/action/createAction.test.ts

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,28 @@ describe('createAction test', () => {
7171
wallet.randomVals = [0.1, 0.2, 0.3, 0.7, 0.8, 0.9]
7272
const root = '02135476'
7373
const kp = _tu.getKeyPair(root.repeat(8))
74-
const createArgs: CreateActionArgs = {
75-
description: `repeatable`,
76-
outputs: [
77-
{
78-
satoshis: 45,
79-
lockingScript: _tu.getLockP2PKH(kp.address).toHex(),
80-
outputDescription: 'pay echo'
81-
}
82-
],
83-
options: {
84-
randomizeOutputs: false,
85-
signAndProcess: true,
86-
noSend: true
74+
const createArgs: CreateActionArgs = {
75+
description: `repeatable`,
76+
outputs: [
77+
{
78+
satoshis: 45,
79+
lockingScript: _tu.getLockP2PKH(kp.address).toHex(),
80+
outputDescription: 'pay echo'
8781
}
82+
],
83+
options: {
84+
randomizeOutputs: false,
85+
signAndProcess: true,
86+
noSend: true
8887
}
89-
90-
const cr = await wallet.createAction(createArgs)
91-
expect(cr.txid === '4f428a93c43c2d120204ecdc06f7916be8a5f4542cc8839a0fd79bd1b44582f3')
9288
}
89+
90+
const cr = await wallet.createAction(createArgs)
91+
expect(
92+
cr.txid ===
93+
'4f428a93c43c2d120204ecdc06f7916be8a5f4542cc8839a0fd79bd1b44582f3'
94+
)
95+
}
9396
})
9497

9598
test('2_signableTransaction', async () => {

0 commit comments

Comments
 (0)