dash-platform-sdk 1.4.0 → 1.5.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -15
- package/bundle.min.js +1 -21
- package/package.json +4 -3
- package/proto/generated/platform.client.d.ts +110 -0
- package/proto/generated/platform.client.js +89 -12
- package/proto/generated/platform.d.ts +1671 -0
- package/proto/generated/platform.js +3381 -1
- package/src/DashPlatformSDK.d.ts +2 -0
- package/src/DashPlatformSDK.js +3 -0
- package/src/constants.d.ts +2 -1
- package/src/constants.js +2 -1
- package/src/identities/createStateTransition.js +2 -2
- package/src/keyPair/index.d.ts +87 -0
- package/src/keyPair/index.js +128 -0
- package/src/node/{epochs.d.ts → epochInfos.d.ts} +1 -1
- package/src/node/{epochs.js → epochInfos.js} +1 -1
- package/src/node/finalizedEpochInfos.d.ts +21 -0
- package/src/node/finalizedEpochInfos.js +54 -0
- package/src/node/index.d.ts +9 -1
- package/src/node/index.js +11 -1
- package/src/platformAddresses/createStateTransition.d.ts +12 -0
- package/src/platformAddresses/createStateTransition.js +62 -0
- package/src/platformAddresses/getAddressesBranchState.d.ts +3 -0
- package/src/platformAddresses/getAddressesBranchState.js +21 -0
- package/src/platformAddresses/getAddressesTrunkState.d.ts +3 -0
- package/src/platformAddresses/getAddressesTrunkState.js +33 -0
- package/src/platformAddresses/getRecentAddressBalanceChanges.d.ts +3 -0
- package/src/platformAddresses/getRecentAddressBalanceChanges.js +38 -0
- package/src/platformAddresses/getRecentCompactedAddressBalanceChanges.d.ts +3 -0
- package/src/platformAddresses/getRecentCompactedAddressBalanceChanges.js +37 -0
- package/src/platformAddresses/index.d.ts +63 -2
- package/src/platformAddresses/index.js +76 -0
- package/src/shielded/createStateTransition.d.ts +3 -0
- package/src/shielded/createStateTransition.js +60 -0
- package/src/shielded/getMostRecentShieldedAnchor.d.ts +2 -0
- package/src/shielded/getMostRecentShieldedAnchor.js +36 -0
- package/src/shielded/getShieldedAnchors.d.ts +2 -0
- package/src/shielded/getShieldedAnchors.js +36 -0
- package/src/shielded/getShieldedEncryptedNotes.d.ts +3 -0
- package/src/shielded/getShieldedEncryptedNotes.js +43 -0
- package/src/shielded/getShieldedNotesCount.d.ts +2 -0
- package/src/shielded/getShieldedNotesCount.js +36 -0
- package/src/shielded/getShieldedNullifiers.d.ts +3 -0
- package/src/shielded/getShieldedNullifiers.js +40 -0
- package/src/shielded/getShieldedPoolState.d.ts +2 -0
- package/src/shielded/getShieldedPoolState.js +36 -0
- package/src/shielded/index.d.ts +131 -0
- package/src/shielded/index.js +188 -0
- package/src/utils/verifyTenderdashProof.js +3 -0
- package/test/unit/Identity.spec.js +1 -1
- package/test/unit/KeyPair.spec.js +80 -0
- package/test/unit/Node.spec.js +6 -0
- package/test/unit/PlatformAddress.spec.js +155 -1
- package/test/unit/Shielded.spec.d.ts +1 -0
- package/test/unit/Shielded.spec.js +237 -0
- package/types.d.ts +153 -2
- package/types.js +1 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import GRPCConnectionPool from '../grpcConnectionPool.js';
|
|
2
|
+
import { ShieldedEncryptedNote, ShieldedNullifierStatus, ShieldedTransitionParamsMap, ShieldedTransitionType } from '../../types.js';
|
|
3
|
+
import { RecoveredNoteWASM, ShieldedBuilderWASM, SpendableNoteWASM, StateTransitionWASM } from 'pshenmic-dpp';
|
|
4
|
+
/**
|
|
5
|
+
* Shielded controller for requesting information about shielded pool
|
|
6
|
+
*
|
|
7
|
+
* @hideconstructor
|
|
8
|
+
*/
|
|
9
|
+
export declare class ShieldedController {
|
|
10
|
+
/** @ignore **/
|
|
11
|
+
grpcPool: GRPCConnectionPool;
|
|
12
|
+
/** @ignore **/
|
|
13
|
+
shieldedBuilder?: ShieldedBuilderWASM;
|
|
14
|
+
constructor(grpcPool: GRPCConnectionPool);
|
|
15
|
+
/**
|
|
16
|
+
* Set bindings instance of builder
|
|
17
|
+
* Needed for custom builder load, because ShieldedBuilderWASM inits very slow on old hardware
|
|
18
|
+
*/
|
|
19
|
+
init(builder?: ShieldedBuilderWASM): Promise<ShieldedBuilderWASM>;
|
|
20
|
+
/**
|
|
21
|
+
* Lazily constructs and caches a {ShieldedBuilderWASM}. Construction builds
|
|
22
|
+
* the Halo 2 proving key (~seconds), so the instance is created once and reused.
|
|
23
|
+
*
|
|
24
|
+
* @ignore
|
|
25
|
+
*/
|
|
26
|
+
getShieldedBuilder(): Promise<ShieldedBuilderWASM>;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves a batch of shielded encrypted notes from the shielded pool,
|
|
29
|
+
* starting from the given note index.
|
|
30
|
+
*
|
|
31
|
+
* Returns an array of encrypted notes, each containing the nullifier,
|
|
32
|
+
* note commitment (cmx), encrypted note payload and value commitment (cvNet).
|
|
33
|
+
*
|
|
34
|
+
* @param startIndex {bigint} - index of the first note to fetch
|
|
35
|
+
* @param count {number} - amount of notes to fetch
|
|
36
|
+
*
|
|
37
|
+
* @return {Promise<ShieldedEncryptedNote[]>}
|
|
38
|
+
*/
|
|
39
|
+
getShieldedEncryptedNotes(startIndex: bigint, count: number): Promise<ShieldedEncryptedNote[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves the set of valid anchors (note commitment tree roots) currently
|
|
42
|
+
* accepted by the shielded pool.
|
|
43
|
+
*
|
|
44
|
+
* @return {Promise<Uint8Array[]>}
|
|
45
|
+
*/
|
|
46
|
+
getShieldedAnchors(): Promise<Uint8Array[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves the most recent anchor (note commitment tree root) of the shielded pool.
|
|
49
|
+
*
|
|
50
|
+
* @return {Promise<Uint8Array>}
|
|
51
|
+
*/
|
|
52
|
+
getMostRecentShieldedAnchor(): Promise<Uint8Array | undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves the total balance currently held in the shielded pool.
|
|
55
|
+
*
|
|
56
|
+
* @return {Promise<bigint>}
|
|
57
|
+
*/
|
|
58
|
+
getShieldedPoolState(): Promise<bigint | undefined>;
|
|
59
|
+
/**
|
|
60
|
+
* Retrieves the total count of notes (leaves) in the shielded notes
|
|
61
|
+
* commitment tree. Useful as a denominator for shielded sync progress.
|
|
62
|
+
*
|
|
63
|
+
* @return {Promise<bigint>}
|
|
64
|
+
*/
|
|
65
|
+
getShieldedNotesCount(): Promise<bigint | undefined>;
|
|
66
|
+
/**
|
|
67
|
+
* Checks the spent status of the given nullifiers in the shielded pool.
|
|
68
|
+
*
|
|
69
|
+
* Returns an array of statuses, each containing the nullifier and whether
|
|
70
|
+
* it has already been spent.
|
|
71
|
+
*
|
|
72
|
+
* @param nullifiers {Uint8Array[]} - nullifiers to check
|
|
73
|
+
*
|
|
74
|
+
* @return {Promise<ShieldedNullifierStatus[]>}
|
|
75
|
+
*/
|
|
76
|
+
getShieldedNullifiers(nullifiers: Uint8Array[]): Promise<ShieldedNullifierStatus[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Recovers the notes owned by a wallet from a set of shielded encrypted notes
|
|
79
|
+
* (as returned by {@link getShieldedEncryptedNotes}) by trial-decrypting each
|
|
80
|
+
* with the viewing key derived from the seed (ZIP-32 m/32'/coinType'/account').
|
|
81
|
+
* Only notes addressed to the wallet are returned, each with its global leaf
|
|
82
|
+
* position (`index`) in the commitment tree.
|
|
83
|
+
*
|
|
84
|
+
* @param notes {ShieldedEncryptedNote[]} - shielded encrypted notes to scan
|
|
85
|
+
* @param seed {Uint8Array} - BIP-39 seed bytes
|
|
86
|
+
* @param account {number} - ZIP-32 account index
|
|
87
|
+
*
|
|
88
|
+
* @return {RecoveredNoteWASM[]}
|
|
89
|
+
*/
|
|
90
|
+
recoverNotes(notes: ShieldedEncryptedNote[], seed: Uint8Array, account: number): RecoveredNoteWASM[];
|
|
91
|
+
/**
|
|
92
|
+
* Rebuilds the note commitment tree from the full on-chain note set and
|
|
93
|
+
* witnesses the given recovered notes against it, producing the spendable
|
|
94
|
+
* notes and the shared anchor required by spend transitions (`shieldedTransfer`,
|
|
95
|
+
* `unshield`, `shieldedWithdrawal`, `identityCreateFromShieldedPool`).
|
|
96
|
+
*
|
|
97
|
+
* Pass the complete note set from {@link getShieldedEncryptedNotes} as `notes`
|
|
98
|
+
* (the commitment tree leaves) and the notes you want to spend from
|
|
99
|
+
* {@link recoverNotes} as `recovered`. This keeps the whole spend flow inside
|
|
100
|
+
* the SDK — no need to construct a commitment tree yourself.
|
|
101
|
+
*
|
|
102
|
+
* @param notes {ShieldedEncryptedNote[]} - full on-chain note set (the tree leaves)
|
|
103
|
+
* @param recovered {RecoveredNoteWASM[]} - the recovered notes to spend
|
|
104
|
+
*
|
|
105
|
+
* @return {{ spends: SpendableNoteWASM[], anchor: Uint8Array }}
|
|
106
|
+
*/
|
|
107
|
+
buildSpendableNotes(notes: ShieldedEncryptedNote[], recovered: RecoveredNoteWASM[]): {
|
|
108
|
+
spends: SpendableNoteWASM[];
|
|
109
|
+
anchor: Uint8Array;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Helper function for building and proving shielded (Orchard) transitions.
|
|
113
|
+
* It may be used to create any of 7 shielded transition actions:
|
|
114
|
+
*
|
|
115
|
+
* 1) shield - transparent platform addresses -> pool (deposit)
|
|
116
|
+
* 2) shieldFromAssetLock - asset lock -> pool (deposit)
|
|
117
|
+
* 3) shieldedWithdrawal - pool -> core L1 (spend)
|
|
118
|
+
* 4) unshield - pool -> platform identity balance (spend)
|
|
119
|
+
* 5) shieldedTransfer - pool -> pool (spend)
|
|
120
|
+
* 6) shieldedTransferMulti - pool -> pool, several recipients, each with its own memo (spend)
|
|
121
|
+
* 7) identityCreateFromShieldedPool - pool -> new identity (spend)
|
|
122
|
+
*
|
|
123
|
+
* Spends require a {SpendableNoteWASM} witnessed against an on-chain anchor.
|
|
124
|
+
*
|
|
125
|
+
* @param type {string} Type of the shielded transition, must be one of ('shield' | 'shieldFromAssetLock' | 'shieldedWithdrawal' | 'unshield' | 'shieldedTransfer' | 'shieldedTransferMulti' | 'identityCreateFromShieldedPool')
|
|
126
|
+
* @param params {ShieldedTransitionParams} params
|
|
127
|
+
*
|
|
128
|
+
* @return {StateTransitionWASM}
|
|
129
|
+
*/
|
|
130
|
+
createStateTransition<K extends ShieldedTransitionType>(type: K, params: ShieldedTransitionParamsMap[K]): Promise<StateTransitionWASM>;
|
|
131
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import getShieldedEncryptedNotes from './getShieldedEncryptedNotes.js';
|
|
2
|
+
import getShieldedAnchors from './getShieldedAnchors.js';
|
|
3
|
+
import getMostRecentShieldedAnchor from './getMostRecentShieldedAnchor.js';
|
|
4
|
+
import getShieldedPoolState from './getShieldedPoolState.js';
|
|
5
|
+
import getShieldedNotesCount from './getShieldedNotesCount.js';
|
|
6
|
+
import getShieldedNullifiers from './getShieldedNullifiers.js';
|
|
7
|
+
import createStateTransition from './createStateTransition.js';
|
|
8
|
+
import { CommitmentTreeWASM, ContractBoundsWASM, IdentityPublicKeyInCreationWASM, recoverNotes, SerializedActionWASM, ShieldedBuilderWASM, ShieldedMemoWASM, SpendableNoteWASM } from 'pshenmic-dpp';
|
|
9
|
+
/**
|
|
10
|
+
* Shielded controller for requesting information about shielded pool
|
|
11
|
+
*
|
|
12
|
+
* @hideconstructor
|
|
13
|
+
*/
|
|
14
|
+
export class ShieldedController {
|
|
15
|
+
/** @ignore **/
|
|
16
|
+
grpcPool;
|
|
17
|
+
/** @ignore **/
|
|
18
|
+
shieldedBuilder;
|
|
19
|
+
constructor(grpcPool) {
|
|
20
|
+
this.grpcPool = grpcPool;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Set bindings instance of builder
|
|
24
|
+
* Needed for custom builder load, because ShieldedBuilderWASM inits very slow on old hardware
|
|
25
|
+
*/
|
|
26
|
+
async init(builder) {
|
|
27
|
+
this.shieldedBuilder = builder ?? new ShieldedBuilderWASM();
|
|
28
|
+
await this.shieldedBuilder.init();
|
|
29
|
+
return this.shieldedBuilder;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Lazily constructs and caches a {ShieldedBuilderWASM}. Construction builds
|
|
33
|
+
* the Halo 2 proving key (~seconds), so the instance is created once and reused.
|
|
34
|
+
*
|
|
35
|
+
* @ignore
|
|
36
|
+
*/
|
|
37
|
+
async getShieldedBuilder() {
|
|
38
|
+
if (this.shieldedBuilder == null) {
|
|
39
|
+
return await this.init();
|
|
40
|
+
}
|
|
41
|
+
return this.shieldedBuilder;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves a batch of shielded encrypted notes from the shielded pool,
|
|
45
|
+
* starting from the given note index.
|
|
46
|
+
*
|
|
47
|
+
* Returns an array of encrypted notes, each containing the nullifier,
|
|
48
|
+
* note commitment (cmx), encrypted note payload and value commitment (cvNet).
|
|
49
|
+
*
|
|
50
|
+
* @param startIndex {bigint} - index of the first note to fetch
|
|
51
|
+
* @param count {number} - amount of notes to fetch
|
|
52
|
+
*
|
|
53
|
+
* @return {Promise<ShieldedEncryptedNote[]>}
|
|
54
|
+
*/
|
|
55
|
+
async getShieldedEncryptedNotes(startIndex, count) {
|
|
56
|
+
return await getShieldedEncryptedNotes(this.grpcPool, startIndex, count);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves the set of valid anchors (note commitment tree roots) currently
|
|
60
|
+
* accepted by the shielded pool.
|
|
61
|
+
*
|
|
62
|
+
* @return {Promise<Uint8Array[]>}
|
|
63
|
+
*/
|
|
64
|
+
async getShieldedAnchors() {
|
|
65
|
+
return await getShieldedAnchors(this.grpcPool);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Retrieves the most recent anchor (note commitment tree root) of the shielded pool.
|
|
69
|
+
*
|
|
70
|
+
* @return {Promise<Uint8Array>}
|
|
71
|
+
*/
|
|
72
|
+
async getMostRecentShieldedAnchor() {
|
|
73
|
+
return await getMostRecentShieldedAnchor(this.grpcPool);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves the total balance currently held in the shielded pool.
|
|
77
|
+
*
|
|
78
|
+
* @return {Promise<bigint>}
|
|
79
|
+
*/
|
|
80
|
+
async getShieldedPoolState() {
|
|
81
|
+
return await getShieldedPoolState(this.grpcPool);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Retrieves the total count of notes (leaves) in the shielded notes
|
|
85
|
+
* commitment tree. Useful as a denominator for shielded sync progress.
|
|
86
|
+
*
|
|
87
|
+
* @return {Promise<bigint>}
|
|
88
|
+
*/
|
|
89
|
+
async getShieldedNotesCount() {
|
|
90
|
+
return await getShieldedNotesCount(this.grpcPool);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Checks the spent status of the given nullifiers in the shielded pool.
|
|
94
|
+
*
|
|
95
|
+
* Returns an array of statuses, each containing the nullifier and whether
|
|
96
|
+
* it has already been spent.
|
|
97
|
+
*
|
|
98
|
+
* @param nullifiers {Uint8Array[]} - nullifiers to check
|
|
99
|
+
*
|
|
100
|
+
* @return {Promise<ShieldedNullifierStatus[]>}
|
|
101
|
+
*/
|
|
102
|
+
async getShieldedNullifiers(nullifiers) {
|
|
103
|
+
return await getShieldedNullifiers(this.grpcPool, nullifiers);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Recovers the notes owned by a wallet from a set of shielded encrypted notes
|
|
107
|
+
* (as returned by {@link getShieldedEncryptedNotes}) by trial-decrypting each
|
|
108
|
+
* with the viewing key derived from the seed (ZIP-32 m/32'/coinType'/account').
|
|
109
|
+
* Only notes addressed to the wallet are returned, each with its global leaf
|
|
110
|
+
* position (`index`) in the commitment tree.
|
|
111
|
+
*
|
|
112
|
+
* @param notes {ShieldedEncryptedNote[]} - shielded encrypted notes to scan
|
|
113
|
+
* @param seed {Uint8Array} - BIP-39 seed bytes
|
|
114
|
+
* @param account {number} - ZIP-32 account index
|
|
115
|
+
*
|
|
116
|
+
* @return {RecoveredNoteWASM[]}
|
|
117
|
+
*/
|
|
118
|
+
recoverNotes(notes, seed, account) {
|
|
119
|
+
// SLIP-44 coin type: 5 = Dash mainnet, 1 = testnets. Orchard derives via ZIP-32
|
|
120
|
+
const coinType = this.grpcPool.network === 'mainnet' ? 5 : 1;
|
|
121
|
+
// ShieldedEncryptedNote carries everything needed for trial-decryption; the
|
|
122
|
+
// spend-authorization fields (rk, spendAuthSig) are unused here, so zero them.
|
|
123
|
+
const actions = notes.map(note => new SerializedActionWASM(note.nullifier, new Uint8Array(32), note.cmx, note.encryptedNote, note.cvNet, new Uint8Array(64)));
|
|
124
|
+
return recoverNotes(actions, seed, coinType, account);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Rebuilds the note commitment tree from the full on-chain note set and
|
|
128
|
+
* witnesses the given recovered notes against it, producing the spendable
|
|
129
|
+
* notes and the shared anchor required by spend transitions (`shieldedTransfer`,
|
|
130
|
+
* `unshield`, `shieldedWithdrawal`, `identityCreateFromShieldedPool`).
|
|
131
|
+
*
|
|
132
|
+
* Pass the complete note set from {@link getShieldedEncryptedNotes} as `notes`
|
|
133
|
+
* (the commitment tree leaves) and the notes you want to spend from
|
|
134
|
+
* {@link recoverNotes} as `recovered`. This keeps the whole spend flow inside
|
|
135
|
+
* the SDK — no need to construct a commitment tree yourself.
|
|
136
|
+
*
|
|
137
|
+
* @param notes {ShieldedEncryptedNote[]} - full on-chain note set (the tree leaves)
|
|
138
|
+
* @param recovered {RecoveredNoteWASM[]} - the recovered notes to spend
|
|
139
|
+
*
|
|
140
|
+
* @return {{ spends: SpendableNoteWASM[], anchor: Uint8Array }}
|
|
141
|
+
*/
|
|
142
|
+
buildSpendableNotes(notes, recovered) {
|
|
143
|
+
// only the leaves we intend to witness need to be marked spendable
|
|
144
|
+
const spendableIndices = new Set(recovered.map(note => note.index));
|
|
145
|
+
const tree = new CommitmentTreeWASM();
|
|
146
|
+
notes.forEach((note, index) => tree.append(note.cmx, spendableIndices.has(index)));
|
|
147
|
+
tree.checkpoint(0);
|
|
148
|
+
const anchor = tree.anchor();
|
|
149
|
+
const spends = recovered.map(recoveredNote => {
|
|
150
|
+
const merklePath = tree.witness(recoveredNote.index, 0) ?? tree.witness(recoveredNote.index, 1);
|
|
151
|
+
if (merklePath == null) {
|
|
152
|
+
throw new Error(`Failed to witness recovered note at index ${recoveredNote.index}`);
|
|
153
|
+
}
|
|
154
|
+
return new SpendableNoteWASM(recoveredNote.note, merklePath);
|
|
155
|
+
});
|
|
156
|
+
return { spends, anchor };
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Helper function for building and proving shielded (Orchard) transitions.
|
|
160
|
+
* It may be used to create any of 7 shielded transition actions:
|
|
161
|
+
*
|
|
162
|
+
* 1) shield - transparent platform addresses -> pool (deposit)
|
|
163
|
+
* 2) shieldFromAssetLock - asset lock -> pool (deposit)
|
|
164
|
+
* 3) shieldedWithdrawal - pool -> core L1 (spend)
|
|
165
|
+
* 4) unshield - pool -> platform identity balance (spend)
|
|
166
|
+
* 5) shieldedTransfer - pool -> pool (spend)
|
|
167
|
+
* 6) shieldedTransferMulti - pool -> pool, several recipients, each with its own memo (spend)
|
|
168
|
+
* 7) identityCreateFromShieldedPool - pool -> new identity (spend)
|
|
169
|
+
*
|
|
170
|
+
* Spends require a {SpendableNoteWASM} witnessed against an on-chain anchor.
|
|
171
|
+
*
|
|
172
|
+
* @param type {string} Type of the shielded transition, must be one of ('shield' | 'shieldFromAssetLock' | 'shieldedWithdrawal' | 'unshield' | 'shieldedTransfer' | 'shieldedTransferMulti' | 'identityCreateFromShieldedPool')
|
|
173
|
+
* @param params {ShieldedTransitionParams} params
|
|
174
|
+
*
|
|
175
|
+
* @return {StateTransitionWASM}
|
|
176
|
+
*/
|
|
177
|
+
async createStateTransition(type, params) {
|
|
178
|
+
// @ts-expect-error a plain string memo is normalized to ShieldedMemoWASM (empty when omitted)
|
|
179
|
+
params.memo = typeof params.memo === 'string' ? ShieldedMemoWASM.fromString(params.memo) : ShieldedMemoWASM.empty();
|
|
180
|
+
if (type === 'identityCreateFromShieldedPool') {
|
|
181
|
+
const identityParams = params;
|
|
182
|
+
// @ts-expect-error builder expects IdentityPublicKeyInCreationWASM instances
|
|
183
|
+
identityParams.publicKeys = identityParams.publicKeys
|
|
184
|
+
.map(({ id, purpose, securityLevel, keyType, readOnly, data, signature, contractBounds }) => new IdentityPublicKeyInCreationWASM(id, purpose, securityLevel, keyType, readOnly, data, signature, (contractBounds != null) ? new ContractBoundsWASM(contractBounds.dataContractId, contractBounds.documentType) : undefined));
|
|
185
|
+
}
|
|
186
|
+
return await createStateTransition(await this.getShieldedBuilder(), type, params);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -4,6 +4,9 @@ import { calculateStateIdHash } from './calculateStateIdHash.js';
|
|
|
4
4
|
import { verifySignatureDigest } from 'pshenmic-dpp';
|
|
5
5
|
import hexToBytes from './hexToBytes.js';
|
|
6
6
|
export default async function verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey) {
|
|
7
|
+
if ((new Date().getTime() - new Date(metadata.timeMs).getTime()) > 15 * 60 * 60 * 1000) {
|
|
8
|
+
throw new Error('Request is stalled (over 15 minutes)');
|
|
9
|
+
}
|
|
7
10
|
const stateId = StateId.create({
|
|
8
11
|
appVersion: String(metadata.protocolVersion),
|
|
9
12
|
coreChainLockedHeight: metadata.coreChainLockedHeight,
|
|
@@ -259,7 +259,7 @@ describe('Identity', () => {
|
|
|
259
259
|
const recipientId = 'HT3pUBM1Uv2mKgdPEN1gxa7A4PdsvNY89aJbdSKQb5wR';
|
|
260
260
|
const amount = 100000n;
|
|
261
261
|
const identityNonce = await sdk.identities.getIdentityNonce(identityId);
|
|
262
|
-
const stateTransition = sdk.identities.createStateTransition('
|
|
262
|
+
const stateTransition = sdk.identities.createStateTransition('withdrawal', { identityId, recipientId, amount, identityNonce });
|
|
263
263
|
expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
|
|
264
264
|
});
|
|
265
265
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OrchardAddressWASM, PlatformAddressWASM } from 'pshenmic-dpp';
|
|
1
2
|
import { DashPlatformSDK } from '../../src/DashPlatformSDK.js';
|
|
2
3
|
let sdk;
|
|
3
4
|
let mnemonic;
|
|
@@ -31,4 +32,83 @@ describe('KeyPair', () => {
|
|
|
31
32
|
expect(key.privateKey).toEqual(Uint8Array.from([89, 255, 64, 41, 202, 170, 83, 68, 135, 58, 161, 107, 130, 20, 3, 50, 69, 16, 108, 104, 32, 68, 13, 100, 225, 24, 79, 20, 193, 184, 238, 55]));
|
|
32
33
|
});
|
|
33
34
|
});
|
|
35
|
+
describe('shielded', () => {
|
|
36
|
+
const account = 0;
|
|
37
|
+
test('should be able to derive a shielded address from seed', () => {
|
|
38
|
+
const seed = sdk.keyPair.mnemonicToSeed(mnemonic);
|
|
39
|
+
const address = sdk.keyPair.deriveShieldedAddress(seed, 'testnet', account);
|
|
40
|
+
expect(address).toEqual(expect.any(OrchardAddressWASM));
|
|
41
|
+
expect(address.bytes()).toHaveLength(43);
|
|
42
|
+
// deterministic for the same seed/network/account
|
|
43
|
+
expect(address.bytes()).toEqual(sdk.keyPair.deriveShieldedAddress(seed, 'testnet', account).bytes());
|
|
44
|
+
});
|
|
45
|
+
test('should derive distinct shielded addresses per diversifier index', () => {
|
|
46
|
+
const seed = sdk.keyPair.mnemonicToSeed(mnemonic);
|
|
47
|
+
const first = sdk.keyPair.deriveShieldedAddress(seed, 'testnet', account, 0);
|
|
48
|
+
const second = sdk.keyPair.deriveShieldedAddress(seed, 'testnet', account, 1);
|
|
49
|
+
expect(first.bytes()).not.toEqual(second.bytes());
|
|
50
|
+
});
|
|
51
|
+
test('should derive distinct shielded addresses per network', () => {
|
|
52
|
+
const seed = sdk.keyPair.mnemonicToSeed(mnemonic);
|
|
53
|
+
const mainnet = sdk.keyPair.deriveShieldedAddress(seed, 'mainnet', account);
|
|
54
|
+
const testnet = sdk.keyPair.deriveShieldedAddress(seed, 'testnet', account);
|
|
55
|
+
expect(mainnet.bytes()).not.toEqual(testnet.bytes());
|
|
56
|
+
});
|
|
57
|
+
test('should be able to derive the outgoing viewing key from seed', () => {
|
|
58
|
+
const seed = sdk.keyPair.mnemonicToSeed(mnemonic);
|
|
59
|
+
const ovk = sdk.keyPair.deriveShieldedOutgoingViewingKey(seed, 'testnet', account);
|
|
60
|
+
expect(ovk).toBeInstanceOf(Uint8Array);
|
|
61
|
+
expect(ovk).toHaveLength(32);
|
|
62
|
+
// deterministic for the same seed/network/account
|
|
63
|
+
expect(ovk).toEqual(sdk.keyPair.deriveShieldedOutgoingViewingKey(seed, 'testnet', account));
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
describe('platform addresses', () => {
|
|
67
|
+
const account = 0;
|
|
68
|
+
// Reference values produced by the dash-platform-extension derivation utils
|
|
69
|
+
// (proven byte-identical to on-chain / desktop-wallet addresses) for the
|
|
70
|
+
// fixed mnemonic above, testnet, account 0.
|
|
71
|
+
const expectedXpub = 'tpubDH6WaqMU1YHJMbPG413my6Dx5DwnsuuL6EzbetEZQac6ixmkByzCGgiibue3HQmHX5JGVUm2fBHKGttJpVkx3NrK5Em9br8GyLd1fVGm7ud';
|
|
72
|
+
const expectedAddresses = [
|
|
73
|
+
'tdash1kr0xt5wj85ht5u464rfysjrq75rewz9mysjwf59p',
|
|
74
|
+
'tdash1kqgy7ngm2wf0zsv20k4mc62s5rapw26yeg6em4jq',
|
|
75
|
+
'tdash1kzlatzl0u06uxrqz8hkc7naz9d2g3v8g7gw83ew3'
|
|
76
|
+
];
|
|
77
|
+
test('derives the DIP-17 account xpub matching the reference', async () => {
|
|
78
|
+
const seed = sdk.keyPair.mnemonicToSeed(mnemonic);
|
|
79
|
+
const xpub = await sdk.keyPair.derivePlatformAccountXpub(seed, 'testnet', account);
|
|
80
|
+
expect(xpub).toEqual(expectedXpub);
|
|
81
|
+
});
|
|
82
|
+
test('derives seed-based addresses matching the reference', async () => {
|
|
83
|
+
const seed = sdk.keyPair.mnemonicToSeed(mnemonic);
|
|
84
|
+
for (let index = 0; index < expectedAddresses.length; index++) {
|
|
85
|
+
const address = await sdk.keyPair.derivePlatformAddress(seed, 'testnet', account, index);
|
|
86
|
+
expect(address).toEqual(expect.any(PlatformAddressWASM));
|
|
87
|
+
expect(address.isP2PKH()).toBe(true);
|
|
88
|
+
expect(address.toBech32m('testnet')).toEqual(expectedAddresses[index]);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
test('xpub-based public derivation reproduces the seed-based addresses', async () => {
|
|
92
|
+
const seed = sdk.keyPair.mnemonicToSeed(mnemonic);
|
|
93
|
+
const xpub = await sdk.keyPair.derivePlatformAccountXpub(seed, 'testnet', account);
|
|
94
|
+
for (let index = 0; index < expectedAddresses.length; index++) {
|
|
95
|
+
const fromXpub = sdk.keyPair.derivePlatformAddressFromXpub(xpub, 'testnet', index);
|
|
96
|
+
expect(fromXpub.toBech32m('testnet')).toEqual(expectedAddresses[index]);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
test('private key derivation yields the same pubkey hash as the address', async () => {
|
|
100
|
+
const seed = sdk.keyPair.mnemonicToSeed(mnemonic);
|
|
101
|
+
for (let index = 0; index < expectedAddresses.length; index++) {
|
|
102
|
+
const privateKey = await sdk.keyPair.derivePlatformAddressPrivateKey(seed, 'testnet', account, index);
|
|
103
|
+
const address = await sdk.keyPair.derivePlatformAddress(seed, 'testnet', account, index);
|
|
104
|
+
expect(privateKey.getPublicKeyHash()).toEqual(Buffer.from(address.hash()).toString('hex'));
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
test('derives distinct addresses per network', async () => {
|
|
108
|
+
const seed = sdk.keyPair.mnemonicToSeed(mnemonic);
|
|
109
|
+
const mainnet = await sdk.keyPair.derivePlatformAddress(seed, 'mainnet', account, 0);
|
|
110
|
+
const testnet = await sdk.keyPair.derivePlatformAddress(seed, 'testnet', account, 0);
|
|
111
|
+
expect(mainnet.bytes()).not.toEqual(testnet.bytes());
|
|
112
|
+
});
|
|
113
|
+
});
|
|
34
114
|
});
|
package/test/unit/Node.spec.js
CHANGED
|
@@ -51,6 +51,12 @@ describe('Node', () => {
|
|
|
51
51
|
expect(epochsInfo.length).toEqual(10);
|
|
52
52
|
expect(epochsInfo.map(epochInfo => epochInfo.number)).toEqual(expectedEpochsNumbers);
|
|
53
53
|
});
|
|
54
|
+
test('should be able to call getFinalizedEpochInfos', async () => {
|
|
55
|
+
const epochsInfo = await sdk.node.getFinalizedEpochsInfo(17100, true, 17110, false);
|
|
56
|
+
const expectedEpochsNumbers = Array.from({ length: 10 }, (_val, index) => 17100 + index);
|
|
57
|
+
expect(epochsInfo.length).toEqual(10);
|
|
58
|
+
expect(epochsInfo.map(epochInfo => epochInfo.epochIndex)).toEqual(expectedEpochsNumbers);
|
|
59
|
+
});
|
|
54
60
|
test('should be able to call getTotalCreditsInPlatform', async () => {
|
|
55
61
|
const totalCredits = await sdk.node.totalCredits();
|
|
56
62
|
expect(Number(totalCredits)).toBeGreaterThan(0);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AddressFundsFeeStrategyStepWASM, AddressWitnessWASM, AssetLockProofWASM, CoreScriptWASM, IdentityPublicKeyInCreationWASM, InputAddressWASM, OutputAddressWASM, OutputAddressNullableCreditsWASM, KeyType, OutPointWASM, PlatformAddressWASM, PrivateKeyWASM, Purpose, SecurityLevel, StateTransitionWASM } from 'pshenmic-dpp';
|
|
2
|
+
import { base58 } from '@scure/base';
|
|
1
3
|
import { DashPlatformSDK } from '../../src/DashPlatformSDK.js';
|
|
2
4
|
let sdk;
|
|
3
5
|
describe('PlatformAddress', () => {
|
|
@@ -14,9 +16,161 @@ describe('PlatformAddress', () => {
|
|
|
14
16
|
const addresses = [
|
|
15
17
|
'tdash1kzg5azscav69z7m6dfzr9ner0a5vt7pn9ca4sz8d',
|
|
16
18
|
'tdash1kqr3cxhgel75ru0yrhj5eq8j8jt92m5enqrfajxw',
|
|
17
|
-
'
|
|
19
|
+
'tdash1kzpjkv364ez6yyaqyvxfdgzcdet2h4mumqcjd2yx'
|
|
18
20
|
];
|
|
19
21
|
const info = await sdk.platformAddresses.getAddressesInfos(addresses);
|
|
20
22
|
expect(info).toHaveLength(addresses.length);
|
|
21
23
|
});
|
|
24
|
+
test('getAddressesTrunkState', async () => {
|
|
25
|
+
const { trunk, metadata } = await sdk.platformAddresses.getAddressesTrunkState();
|
|
26
|
+
expect(trunk.rootHash).toEqual(expect.any(Uint8Array));
|
|
27
|
+
expect(trunk.elements.length).toBeGreaterThan(0);
|
|
28
|
+
expect(trunk.chunkDepths.length).toBeGreaterThan(0);
|
|
29
|
+
expect(metadata.height).toBeDefined();
|
|
30
|
+
});
|
|
31
|
+
test('getAddressesBranchState', async () => {
|
|
32
|
+
const { trunk, metadata } = await sdk.platformAddresses.getAddressesTrunkState();
|
|
33
|
+
// The whole tree fits in the trunk when it is small enough - nothing to descend into
|
|
34
|
+
if (trunk.leafKeys.length === 0) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const [leaf] = trunk.leafKeys;
|
|
38
|
+
const depth = trunk.chunkDepths[1] ?? trunk.chunkDepths[0];
|
|
39
|
+
const branch = await sdk.platformAddresses.getAddressesBranchState(leaf.key, depth, BigInt(metadata.height), leaf.hash);
|
|
40
|
+
expect(branch.branchRootHash).toEqual(leaf.hash);
|
|
41
|
+
expect(branch.elements.length).toBeGreaterThan(0);
|
|
42
|
+
});
|
|
43
|
+
test('getRecentAddressBalanceChanges', async () => {
|
|
44
|
+
const blocks = await sdk.platformAddresses.getRecentAddressBalanceChanges(1n);
|
|
45
|
+
expect(Array.isArray(blocks)).toBe(true);
|
|
46
|
+
for (const block of blocks) {
|
|
47
|
+
expect(block.blockHeight).toEqual(expect.any(BigInt));
|
|
48
|
+
for (const change of block.changes) {
|
|
49
|
+
expect(change.address).toEqual(expect.any(PlatformAddressWASM));
|
|
50
|
+
expect(['setCredits', 'addToCredits']).toContain(change.operation);
|
|
51
|
+
expect(change.credits).toEqual(expect.any(BigInt));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
test('getRecentCompactedAddressBalanceChanges', async () => {
|
|
56
|
+
const ranges = await sdk.platformAddresses.getRecentCompactedAddressBalanceChanges(1n);
|
|
57
|
+
expect(Array.isArray(ranges)).toBe(true);
|
|
58
|
+
for (const range of ranges) {
|
|
59
|
+
expect(range.startBlockHeight).toEqual(expect.any(BigInt));
|
|
60
|
+
expect(range.endBlockHeight).toBeGreaterThanOrEqual(range.startBlockHeight);
|
|
61
|
+
for (const change of range.changes) {
|
|
62
|
+
expect(change.address).toEqual(expect.any(PlatformAddressWASM));
|
|
63
|
+
expect(['setCredits', 'addToCreditsOperations']).toContain(change.operation);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
describe('createStateTransition', () => {
|
|
68
|
+
const identityId = 'QMfCRPcjXoTnZa9sA9JR2KWgGxZXMRJ4akgS3Uia1Qv';
|
|
69
|
+
const addressA = PlatformAddressWASM.fromBech32m('tdash1kzg5azscav69z7m6dfzr9ner0a5vt7pn9ca4sz8d');
|
|
70
|
+
const addressB = PlatformAddressWASM.fromBech32m('tdash1kqr3cxhgel75ru0yrhj5eq8j8jt92m5enqrfajxw');
|
|
71
|
+
const inputs = [new InputAddressWASM(addressA, 0, 100000n)];
|
|
72
|
+
const outputs = [new OutputAddressWASM(addressB, 50000n)];
|
|
73
|
+
const recipients = [new OutputAddressWASM(addressB, 50000n)];
|
|
74
|
+
const nullableOutputs = [new OutputAddressNullableCreditsWASM(addressB)];
|
|
75
|
+
const feeStrategy = [AddressFundsFeeStrategyStepWASM.DeductFromInput(1)];
|
|
76
|
+
const inputWitness = [AddressWitnessWASM.P2PKH(new Uint8Array(65))];
|
|
77
|
+
const output = new OutputAddressWASM(addressA, 10000n);
|
|
78
|
+
const nonce = 1n;
|
|
79
|
+
const privateKey = PrivateKeyWASM.fromHex('a1286dd195e2b8e1f6bdc946c56a53e0c544750d6452ddc0f4c593ef311f21af', 'testnet');
|
|
80
|
+
const publicKeys = [
|
|
81
|
+
new IdentityPublicKeyInCreationWASM(0, Purpose.AUTHENTICATION, SecurityLevel.MASTER, KeyType.ECDSA_SECP256K1, false, privateKey.getPublicKey().bytes())
|
|
82
|
+
];
|
|
83
|
+
const assetLockProof = AssetLockProofWASM.createChainAssetLockProof(1337, new OutPointWASM('61aede830477254876d435a317241ad46753c4b1350dc991a45ebcf19ab80a11', 0));
|
|
84
|
+
const withdrawalAddress = 'yjHVQ3dj37UJwXFmvMTKR9ZVfoJSc3opTD';
|
|
85
|
+
const outputScript = CoreScriptWASM.newP2PKH(base58.decode(withdrawalAddress).slice(1, 21));
|
|
86
|
+
test('should be able to create identityCreditTransferToAddresses', () => {
|
|
87
|
+
const stateTransition = sdk.platformAddresses.createStateTransition('identityCreditTransferToAddresses', {
|
|
88
|
+
identityId, recipients, nonce
|
|
89
|
+
});
|
|
90
|
+
expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
|
|
91
|
+
});
|
|
92
|
+
test('should throw when identityCreditTransferToAddresses is missing recipients', () => {
|
|
93
|
+
// @ts-expect-error testing the runtime missing-param check
|
|
94
|
+
expect(() => sdk.platformAddresses.createStateTransition('identityCreditTransferToAddresses', {
|
|
95
|
+
identityId, nonce
|
|
96
|
+
})).toThrow('Platform address transition param "recipients" is missing');
|
|
97
|
+
});
|
|
98
|
+
test('should be able to create identityCreateFromAddresses', () => {
|
|
99
|
+
const stateTransition = sdk.platformAddresses.createStateTransition('identityCreateFromAddresses', {
|
|
100
|
+
publicKeys, inputs, feeStrategy, inputWitness
|
|
101
|
+
});
|
|
102
|
+
expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
|
|
103
|
+
});
|
|
104
|
+
test('should throw when identityCreateFromAddresses is missing publicKeys', () => {
|
|
105
|
+
// @ts-expect-error testing the runtime missing-param check
|
|
106
|
+
expect(() => sdk.platformAddresses.createStateTransition('identityCreateFromAddresses', {
|
|
107
|
+
inputs, feeStrategy, inputWitness
|
|
108
|
+
})).toThrow('Platform address transition param "publicKeys" is missing');
|
|
109
|
+
});
|
|
110
|
+
test('should be able to create identityTopUpFromAddresses', () => {
|
|
111
|
+
const stateTransition = sdk.platformAddresses.createStateTransition('identityTopUpFromAddresses', {
|
|
112
|
+
identityId, inputs, feeStrategy, inputWitness
|
|
113
|
+
});
|
|
114
|
+
expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
|
|
115
|
+
});
|
|
116
|
+
test('should throw when identityTopUpFromAddresses is missing identityId', () => {
|
|
117
|
+
// @ts-expect-error testing the runtime missing-param check
|
|
118
|
+
expect(() => sdk.platformAddresses.createStateTransition('identityTopUpFromAddresses', {
|
|
119
|
+
inputs, feeStrategy, inputWitness
|
|
120
|
+
})).toThrow('Platform address transition param "identityId" is missing');
|
|
121
|
+
});
|
|
122
|
+
test('should be able to create addressFundsTransfer', () => {
|
|
123
|
+
const stateTransition = sdk.platformAddresses.createStateTransition('addressFundsTransfer', {
|
|
124
|
+
inputs, feeStrategy, inputWitness, outputs
|
|
125
|
+
});
|
|
126
|
+
expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
|
|
127
|
+
});
|
|
128
|
+
test('should throw when addressFundsTransfer is missing outputs', () => {
|
|
129
|
+
// @ts-expect-error testing the runtime missing-param check
|
|
130
|
+
expect(() => sdk.platformAddresses.createStateTransition('addressFundsTransfer', {
|
|
131
|
+
inputs, feeStrategy, inputWitness
|
|
132
|
+
})).toThrow('Platform address transition param "outputs" is missing');
|
|
133
|
+
});
|
|
134
|
+
test('should be able to create addressFundingFromAssetLock', () => {
|
|
135
|
+
const stateTransition = sdk.platformAddresses.createStateTransition('addressFundingFromAssetLock', {
|
|
136
|
+
assetLockProof, inputs, feeStrategy, inputWitness, outputs: nullableOutputs
|
|
137
|
+
});
|
|
138
|
+
expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
|
|
139
|
+
});
|
|
140
|
+
test('should throw when addressFundingFromAssetLock is missing assetLockProof', () => {
|
|
141
|
+
// @ts-expect-error testing the runtime missing-param check
|
|
142
|
+
expect(() => sdk.platformAddresses.createStateTransition('addressFundingFromAssetLock', {
|
|
143
|
+
inputs, feeStrategy, inputWitness, outputs: nullableOutputs
|
|
144
|
+
})).toThrow('Platform address transition param "assetLockProof" is missing');
|
|
145
|
+
});
|
|
146
|
+
test('should be able to create addressCreditWithdrawal', () => {
|
|
147
|
+
const stateTransition = sdk.platformAddresses.createStateTransition('addressCreditWithdrawal', {
|
|
148
|
+
inputs, feeStrategy, coreFeePerByte: 1, pooling: 'Standard', outputScript, inputWitness
|
|
149
|
+
});
|
|
150
|
+
expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
|
|
151
|
+
});
|
|
152
|
+
test('should be able to create addressCreditWithdrawal with optional output', () => {
|
|
153
|
+
const stateTransition = sdk.platformAddresses.createStateTransition('addressCreditWithdrawal', {
|
|
154
|
+
inputs, feeStrategy, coreFeePerByte: 1, pooling: 'Standard', outputScript, inputWitness, output
|
|
155
|
+
});
|
|
156
|
+
expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
|
|
157
|
+
});
|
|
158
|
+
test('should throw when addressCreditWithdrawal is missing outputScript', () => {
|
|
159
|
+
// @ts-expect-error testing the runtime missing-param check
|
|
160
|
+
expect(() => sdk.platformAddresses.createStateTransition('addressCreditWithdrawal', {
|
|
161
|
+
inputs, feeStrategy, coreFeePerByte: 1, pooling: 'Standard', inputWitness
|
|
162
|
+
})).toThrow('Platform address transition param "outputScript" is missing');
|
|
163
|
+
});
|
|
164
|
+
test('should default userFeeIncrease to 0 when omitted', () => {
|
|
165
|
+
const stateTransition = sdk.platformAddresses.createStateTransition('addressFundsTransfer', {
|
|
166
|
+
inputs, feeStrategy, inputWitness, outputs
|
|
167
|
+
});
|
|
168
|
+
expect(stateTransition).toEqual(expect.any(StateTransitionWASM));
|
|
169
|
+
});
|
|
170
|
+
test('should throw on unimplemented transition type', () => {
|
|
171
|
+
expect(() => sdk.platformAddresses.createStateTransition(
|
|
172
|
+
// @ts-expect-error testing an unknown transition type
|
|
173
|
+
'unknownTransition', {})).toThrow('Unimplemented transition type: unknownTransition');
|
|
174
|
+
});
|
|
175
|
+
});
|
|
22
176
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|