Skip to content

Commit b3cc55e

Browse files
committed
chore: fmt
1 parent 7cc136e commit b3cc55e

3 files changed

Lines changed: 37 additions & 15 deletions

File tree

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/das
1616
The included dev container provides a ready-to-use environment with Node.js, dependencies, and
1717
editor tooling pre-configured. Open the repo in [GitHub
1818
Codespaces](https://codespaces.new/dashpay/platform-tutorials) or locally with the [VS Code Dev
19-
Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
19+
Containers
20+
extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
2021

2122
On first launch the container installs dependencies and creates a starter `.env` file from
22-
`.env.example`. Run `node create-wallet.mjs` to generate a mnemonic, then set `PLATFORM_MNEMONIC`
23-
in your `.env` file to begin the tutorials.
23+
`.env.example`. Run `node create-wallet.mjs` to generate a mnemonic, then set `PLATFORM_MNEMONIC` in
24+
your `.env` file to begin the tutorials.
2425

2526
## Install
2627

@@ -63,8 +64,8 @@ Some client configuration options are included as comments in
6364

6465
## Testing
6566

66-
Tests run each tutorial as a subprocess and validate its output. No test framework
67-
dependencies are required — tests use the Node.js built-in test runner.
67+
Tests run each tutorial as a subprocess and validate its output. No test framework dependencies are
68+
required — tests use the Node.js built-in test runner.
6869

6970
Ensure your `.env` file is configured (see [`.env.example`](./.env.example)) before running tests.
7071

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Tutorial code for https://docs.dash.org/platform",
55
"main": "connect.mjs",
66
"scripts": {
7-
"fmt": "npx prettier@2 --write '**/*.{md,js,mjs}'",
7+
"fmt": "npx prettier@3.8.1 --write '**/*.{js,mjs}'",
88
"lint": "npx -p typescript@4 tsc",
99
"test": "node --test --test-timeout=120000 test/read-only.test.mjs",
1010
"test:read-only": "node --test --test-timeout=120000 test/read-only.test.mjs",

test/setupDashClient.test.mjs

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,10 @@ describe('IdentityKeyManager', function suite() {
517517

518518
it('should skip occupied indices and return first unused', async function () {
519519
const fakeSdk = await fakeSdkWithOccupiedIndices([0, 1]);
520-
const idx = await IdentityKeyManager.findNextIndex(fakeSdk, TEST_MNEMONIC);
520+
const idx = await IdentityKeyManager.findNextIndex(
521+
fakeSdk,
522+
TEST_MNEMONIC,
523+
);
521524
expect(idx).to.equal(2);
522525
});
523526
});
@@ -619,7 +622,10 @@ describe('AddressKeyManager', function suite() {
619622
let queriedAddress;
620623
const fakeSdk = {
621624
addresses: {
622-
get: async (addr) => { queriedAddress = addr; return fakeInfo; },
625+
get: async (addr) => {
626+
queriedAddress = addr;
627+
return fakeInfo;
628+
},
623629
},
624630
};
625631
const mgr = new AddressKeyManager(
@@ -649,7 +655,10 @@ describe('AddressKeyManager', function suite() {
649655
let queriedAddress;
650656
const fakeSdk = {
651657
addresses: {
652-
get: async (addr) => { queriedAddress = addr; return fakeInfo; },
658+
get: async (addr) => {
659+
queriedAddress = addr;
660+
return fakeInfo;
661+
},
653662
},
654663
};
655664
const mgr = new AddressKeyManager(
@@ -756,15 +765,19 @@ describe('setupDashClient()', function () {
756765
expect.fail('should have thrown');
757766
} catch (err) {
758767
expect(err).to.be.an.instanceOf(Error);
759-
expect(err.message).to.not.include('Cannot read properties of undefined');
768+
expect(err.message).to.not.include(
769+
'Cannot read properties of undefined',
770+
);
760771
}
761772

762773
try {
763774
addressKeyManager.getSigner();
764775
expect.fail('should have thrown');
765776
} catch (err) {
766777
expect(err).to.be.an.instanceOf(Error);
767-
expect(err.message).to.not.include('Cannot read properties of undefined');
778+
expect(err.message).to.not.include(
779+
'Cannot read properties of undefined',
780+
);
768781
}
769782
} finally {
770783
clientConfig.mnemonic = saved;
@@ -814,8 +827,14 @@ describe('setupDashClient()', function () {
814827
// proving identityIndex is forwarded. We just need it not to crash
815828
// before reaching the identity lookup.
816829
// Use requireIdentity: false to avoid the lookup and verify the index is stored.
817-
const r0 = await setupDashClient({ requireIdentity: false, identityIndex: 0 });
818-
const r1 = await setupDashClient({ requireIdentity: false, identityIndex: 1 });
830+
const r0 = await setupDashClient({
831+
requireIdentity: false,
832+
identityIndex: 0,
833+
});
834+
const r1 = await setupDashClient({
835+
requireIdentity: false,
836+
identityIndex: 1,
837+
});
819838
expect(r0.keyManager.identityIndex).to.equal(0);
820839
expect(r1.keyManager.identityIndex).to.equal(1);
821840
// Different indices must produce different keys
@@ -832,7 +851,10 @@ describe('setupDashClient()', function () {
832851
const saved = clientConfig.mnemonic;
833852
try {
834853
clientConfig.mnemonic = TEST_MNEMONIC;
835-
const result = await setupDashClient({ requireIdentity: false, identityIndex: 42 });
854+
const result = await setupDashClient({
855+
requireIdentity: false,
856+
identityIndex: 42,
857+
});
836858
expect(result.keyManager).to.be.an.instanceOf(IdentityKeyManager);
837859
expect(result.keyManager.identityIndex).to.equal(42);
838860
expect(result.keyManager.identityId).to.be.null;
@@ -916,4 +938,3 @@ describe('dip13KeyPath()', function () {
916938
expect(path).to.equal("m/9'/5'/5'/0'/0'/0'/0'");
917939
});
918940
});
919-

0 commit comments

Comments
 (0)