Skip to content

Commit 550622f

Browse files
committed
Added snapshot tests for ADA
1 parent 73cb97d commit 550622f

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
lines changed

packages/test/src/runTests.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import testXrp3 from "./testXrp3";
1313
import testStr from "./testStr";
1414
import testStr2 from "./testStr2";
1515
import testStr3 from "./testStr3";
16+
import testAda from "./testAda";
17+
import testAda2 from "./testAda2";
18+
import testAda3 from "./testAda3";
19+
import testAda4 from "./testAda4";
1620

1721
function expectAppContext(appName) {
1822
// TODO improve this by waiting user to do an action?
@@ -41,7 +45,12 @@ var tests = [
4145
expectAppContext("Stellar"),
4246
{ name: "testStr", run: testStr },
4347
{ name: "testStr2", run: testStr2 },
44-
{ name: "testStr3", run: testStr3 }
48+
{ name: "testStr3", run: testStr3 },
49+
expectAppContext("Cardano (ada)"),
50+
{ name: "testAda", run: testAda },
51+
{ name: "testAda2", run: testAda2 },
52+
{ name: "testAda3", run: testAda3 },
53+
{ name: "testAda4", run: testAda4 }
4554
];
4655

4756
const defaultWaitForAppSwitch = step =>

packages/test/src/testAda.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import Ada from "@ledgerhq/hw-app-ada";
22

33
export default async transport => {
44
const ada = new Ada(transport);
5-
const result = await ada.isConnected();
5+
const result = await ada.getWalletRecoveryPassphrase();
66
return result;
77
};

packages/test/src/testAda2.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Ada from "@ledgerhq/hw-app-ada";
2+
3+
export default async transport => {
4+
const ada = new Ada(transport);
5+
const result = await ada.isConnected();
6+
return result;
7+
};

packages/test/src/testAda3.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Ada from "@ledgerhq/hw-app-ada";
2+
3+
export default async transport => {
4+
const ada = new Ada(transport);
5+
const result = await ada.getWalletPublicKeyWithIndex(0xFEEDBEEF);
6+
return result;
7+
};

packages/test/src/testAda4.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Ada from "@ledgerhq/hw-app-ada";
2+
3+
export default async transport => {
4+
const ada = new Ada(transport);
5+
const tx = "839F8200D8185826825820E981442C2BE40475BB42193CA35907861D90715854DE6FCBA767B98F1789B51219439AFF9F8282D818584A83581CE7FE8E468D2249F18CD7BF9AEC0D4374B7D3E18609EDE8589F82F7F0A20058208200581C240596B9B63FC010C06FBE92CF6F820587406534795958C411E662DC014443C0688E001A6768CC861B0037699E3EA6D064FFA0";
6+
const result = await ada.signTransaction(tx, [0xFFFFFFFF]);
7+
return result;
8+
};

0 commit comments

Comments
 (0)