Skip to content

Commit

Permalink
Merge pull request #39 from vechainfoundation/carpini/merge-2023-10-10
Browse files Browse the repository at this point in the history
Carpini/merge 2023 10 10
  • Loading branch information
davidecarpini authored Oct 10, 2023
2 parents 2bd22e8 + 7187701 commit a4b3a75
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 17 deletions.
2 changes: 1 addition & 1 deletion libs/ledgerjs/packages/cryptoassets/src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ function convertVechainToken([
id: "vechain/vtho",
contractAddress: contractAddress,
parentCurrency: getCryptoCurrencyById("vechain"),
tokenType: "erc20",
tokenType: "vip180",
name,
ticker,
disableCountervalue: !enableCountervalues,
Expand Down
13 changes: 11 additions & 2 deletions libs/ledgerjs/packages/hw-app-vet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@
"test": "jest"
},
"devDependencies": {
"typescript": "^4"
}
"@ledgerhq/hw-transport-mocker": "workspace:^",
"source-map-support": "^0.5.21",
"typescript": "^4",
"@types/jest": "^29.5.0",
"jest": "^28.1.1",
"ts-jest": "^28.0.5",
"@types/node": "^18.15.3",
"documentation": "13.2.5",
"ts-node": "^10.4.0"
},
"gitHead": "dd0dea64b58e5a9125c8a422dcffd29e5ef6abec"
}
18 changes: 6 additions & 12 deletions libs/ledgerjs/packages/hw-app-vet/tests/Vechain.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
openTransportReplayer,
RecordStore,
} from "@ledgerhq/hw-transport-mocker";
import { openTransportReplayer, RecordStore } from "@ledgerhq/hw-transport-mocker";
import Vet from "../src/Vet";
import { Transaction as ThorTransaction } from "thor-devkit";

Expand All @@ -10,7 +7,7 @@ test("getAppConfiguration", async () => {
RecordStore.fromString(`
=> e006000000
<= 030100079000
`)
`),
);
const vet = new Vet(transport);
const result = await vet.getAppConfiguration();
Expand All @@ -24,7 +21,7 @@ test("Get address", async () => {
RecordStore.fromString(`
=> e002000015058000002c80000332800000000000000000000000
<= 410482c44bc99cdf08d4360c97fbf62d387288ab75c576926943ad90059002720e93f58799391393c98ad41136aa4ac871b103d25cb9a88f1aadd7dbbe3c7794888928333234373631393364346133323438383332326666426239383335613763463263376532323032439000
`)
`),
);
const vet = new Vet(transport);
const { address } = await vet.getAddress("44'/818'/0'/0/0");
Expand All @@ -36,7 +33,7 @@ test("signMessage", async () => {
RecordStore.fromString(`
=> e004000037058000002c80000332800000000000000000000000e1278012d8d7940000000000000000000000000000000000000000808080808080c0
<= dd0ad907f6cfdd068226999eee0d20789732905270a7c4ed385872599f40978e043a5d7a15e396e59e9c9e921be5f4e02e3b6284b8cf835443f4123ca20b5b35009000
`)
`),
);

const unsigned = new ThorTransaction({
Expand All @@ -57,12 +54,9 @@ test("signMessage", async () => {
});

const vet = new Vet(transport);
const res = await vet.signTransaction(
"44'/818'/0'/0/0",
unsigned.encode().toString("hex")
);
const res = await vet.signTransaction("44'/818'/0'/0/0", unsigned.encode().toString("hex"));

expect(res.toString("hex")).toEqual(
"dd0ad907f6cfdd068226999eee0d20789732905270a7c4ed385872599f40978e043a5d7a15e396e59e9c9e921be5f4e02e3b6284b8cf835443f4123ca20b5b3500"
"dd0ad907f6cfdd068226999eee0d20789732905270a7c4ed385872599f40978e043a5d7a15e396e59e9c9e921be5f4e02e3b6284b8cf835443f4123ca20b5b3500",
);
});
91 changes: 89 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a4b3a75

Please sign in to comment.