-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: remove from aptos blockchain from families #8897
Open
jccguimaraes
wants to merge
58
commits into
develop
Choose a base branch
from
feat/coin-aptos
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,395
β1,229
Open
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
4f3b88c
chore: remove from aptos blockchain from families
jccguimaraes 8f6e936
chore: remove from aptos blockchain from families
jccguimaraes a065bcf
Merge branch 'develop' into feat/coin-aptos
jccguimaraes 3b96235
chore: remove from aptos blockchain from families
jccguimaraes 3923584
chore: remove from aptos blockchain from families
jccguimaraes ccc7059
chore: remove from aptos blockchain from families
jccguimaraes 0c416cb
chore: remove from aptos blockchain from families
jccguimaraes df8ca58
Merge branch 'develop' into feat/coin-aptos
jccguimaraes 6fa7b65
chore: remove from aptos blockchain from families
jccguimaraes 08a5621
chore: remove aptos blockchain from families
jccguimaraes 7b80570
chore: remove aptos blockchain from families
jccguimaraes b60b41f
chore: remove aptos blockchain from families
jccguimaraes 3dab3c8
chore: remove aptos blockchain from families
jccguimaraes abfa132
Merge branch 'develop' into feat/coin-aptos
jccguimaraes f58983f
chore: remove aptos blockchain from families
jccguimaraes 5a0e380
test: update tests
jccguimaraes b6e5c2d
test: update bot test
jccguimaraes 21e7ac4
test: api unit tests
semeano ab4fc2f
test: broadcast unit tests
semeano d1cc7df
Merge branch 'develop' into feat/coin-aptos
semeano c8deb53
chore: save work
semeano 1b4a8b9
build: update packages
semeano cf9e952
test: fix unit tests
semeano cac2ac8
test: fix unit tests
semeano a4aacc3
fix: update aptos bot test
jccguimaraes 12ea13c
test: fix unit tests
semeano cfcbd63
test: unit test for deviceTransactionConfig
semeano 6f14cee
test: unit test for signer
semeano 28a8720
test: unit test for network
semeano 72f22ca
fix: remove script from package.json
semeano a91f967
fix: logic and logic tests
semeano c9d2649
chore: disable sign operation tests temporarily
semeano d36bc27
chore: remove commented code
semeano fdf6ba4
chore: move tests to __tests__
semeano 4b33419
test: unit tests for sign operation
semeano 60b232c
Merge branch 'develop' into feat/coin-aptos
semeano e318d46
chore: add changeset
semeano 21d3326
fix: remove duplicated changeset
semeano 3575f39
fix: update changeset summary
semeano 1960697
fix: remove unused file
semeano ae3fe41
fix: remove comments
semeano 89be594
fix: remove comments
semeano 8b19cde
fix: remove catch argument
semeano 3f8e06f
fix: remove comments
semeano b6a5784
fix: remove random account address
semeano a5c27d5
fix: remove commented code
semeano a733d70
fix: bridge integration test
semeano 898d854
test: unit test for network
semeano 01e1fcf
fix: wrong import path
semeano 5e31781
fix: add unresolved and unused packages to ignore
semeano a45213b
build: remove unused package
semeano 815ecfc
chore: restore e2e send test
semeano b31387c
chore: restore apdus
semeano afd204e
fix: getAccountShape
semeano 05da067
test: fix unit tests for synchronization and network
semeano 142ad95
test: update bridge integration tests snapshot
semeano 6df7dd4
Merge branch 'develop' into feat/coin-aptos
semeano 587ccac
fix: remove unused dependency
semeano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@ledgerhq/hw-app-aptos": minor | ||
"@ledgerhq/coin-aptos": minor | ||
"ledger-live-desktop": minor | ||
"live-mobile": minor | ||
"@ledgerhq/live-common": minor | ||
--- | ||
|
||
support: move aptos to its own coin module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"ignoreUnresolved": ["follow-redirects", "form-data", "proxy-from-env"], | ||
"ignoreUnused": ["@ledgerhq/devices", "invariant", "expect"], | ||
"ignoreUnimported": [ | ||
"src/bridge/deviceTransactionConfig.ts", | ||
"src/bridge/transaction.ts", | ||
"src/bridge/bridge.fixture.ts", | ||
"src/errors.ts", | ||
"src/hw-signMessage.ts", | ||
"src/test/bot-specs.ts", | ||
"src/test/bridgeDatasetTest.ts", | ||
"src/test/cli.ts", | ||
"src/test/index.ts", | ||
"src/test/speculos-deviceActions.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ | ||
module.exports = { | ||
collectCoverageFrom: ["src/**/*.ts"], | ||
coverageDirectory: "coverage", | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
testPathIgnorePatterns: ["lib/", "lib-es/", ".integration.test.ts"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"name": "@ledgerhq/coin-aptos", | ||
"version": "1.3.2", | ||
"description": "Ledger Aptos Coin integration", | ||
"keywords": [ | ||
"Ledger", | ||
"LedgerWallet", | ||
"apt", | ||
"Aptos", | ||
"Hardware Wallet" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/LedgerHQ/ledger-live.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/LedgerHQ/ledger-live/issues" | ||
}, | ||
"homepage": "https://github.com/LedgerHQ/ledger-live/tree/develop/libs/coin-modules/coin-aptos", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"lib/*": [ | ||
"lib/*" | ||
], | ||
"lib-es/*": [ | ||
"lib-es/*" | ||
], | ||
"specs": [ | ||
"lib/test/bot-specs" | ||
], | ||
"*": [ | ||
"lib/*", | ||
"lib/api/*", | ||
"lib/bridge/*", | ||
"lib/common-logic/*", | ||
"lib/signer/*", | ||
"lib/test/*", | ||
"lib/types/*" | ||
] | ||
} | ||
}, | ||
"exports": { | ||
"./lib/*": "./lib/*.js", | ||
"./lib-es/*": "./lib-es/*.js", | ||
"./api": { | ||
"require": "./lib/api/index.js", | ||
"default": "./lib-es/api/index.js" | ||
}, | ||
"./deviceTransactionConfig": { | ||
"require": "./lib/bridge/deviceTransactionConfig.js", | ||
"default": "./lib-es/bridge/deviceTransactionConfig.js" | ||
}, | ||
"./signer": { | ||
"require": "./lib/signer/index.js", | ||
"default": "./lib-es/signer/index.js" | ||
}, | ||
"./specs": { | ||
"require": "./lib/test/bot-specs.js", | ||
"default": "./lib-es/test/bot-specs.js" | ||
}, | ||
"./transaction": { | ||
"require": "./lib/bridge/transaction.js", | ||
"default": "./lib-es/bridge/transaction.js" | ||
}, | ||
"./types": { | ||
"require": "./lib/types/index.js", | ||
"default": "./lib-es/types/index.js" | ||
}, | ||
"./*": { | ||
"require": "./lib/*.js", | ||
"default": "./lib-es/*.js" | ||
}, | ||
".": { | ||
"require": "./lib/index.js", | ||
"default": "./lib-es/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@ledgerhq/coin-framework": "workspace:^", | ||
"@ledgerhq/cryptoassets": "workspace:^", | ||
"@ledgerhq/devices": "workspace:*", | ||
"@ledgerhq/errors": "workspace:^", | ||
"@ledgerhq/live-env": "workspace:^", | ||
"@ledgerhq/live-network": "workspace:^", | ||
"@ledgerhq/logs": "workspace:^", | ||
"@ledgerhq/types-live": "workspace:^", | ||
"@aptos-labs/ts-sdk": "^1.33.1", | ||
"@apollo/client": "^3.12.6", | ||
"@noble/hashes": "1.7.0", | ||
"bignumber.js": "^9.1.2", | ||
"graphql": "^16.10.0", | ||
"invariant": "^2.2.4", | ||
"lodash": "^4.17.21", | ||
"rxjs": "^7.8.1" | ||
}, | ||
"devDependencies": { | ||
"@faker-js/faker": "^9.4.0", | ||
"@types/invariant": "^2.2.37", | ||
"@types/jest": "^29.5.14", | ||
"@types/lodash": "^4.17.14", | ||
"@types/semver": "^7.5.8", | ||
"jest": "^29.7.0", | ||
"ts-jest": "^29.2.5", | ||
"axios": "^1.7.9", | ||
"react": "^18.3.1" | ||
}, | ||
"scripts": { | ||
"clean": "rimraf lib lib-es", | ||
"build": "tsc && tsc -m ES6 --outDir lib-es", | ||
"coverage": "jest --coverage --testPathIgnorePatterns='/bridge.integration.test.ts|node_modules|lib-es|lib/' --coveragePathIgnorePatterns='src/test|src/types|src/index.ts|src/bridge/bridge.fixture.ts' --passWithNoTests && mv coverage/coverage-final.json coverage/coverage-aptos.json", | ||
"prewatch": "pnpm build", | ||
"watch": "tsc --watch", | ||
"doc": "documentation readme src/** --section=API --pe ts --re ts --re d.ts", | ||
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache", | ||
"lint:fix": "pnpm lint --fix", | ||
"test": "jest", | ||
"unimported": "unimported" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
...mmon/src/families/aptos/broadcast.test.ts β ...os/src/__tests__/bridge/broadcast.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../families/aptos/createTransaction.test.ts β ..._tests__/bridge/createTransaction.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to inject the type for the generic Mocked ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I do that, I get a
Type 'MockedObjectDeep<typeof Aptos>' is not assignable to type 'Mocked<Aptos>'
If I do
I get
Type '{ getAccountInfo: Mock<any, any, any>; }' is missing the following properties from type 'Aptos': config, account, ans, coin, and 111 more
Basically I'm not able to mock it without adding all of its properties.
Let me know if there's a better way to do it, I also hate to use
any
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you try with
jest.MockedObjectDeep<Partial<typeof Aptos>>
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Partial, I get an error on line 71:
mockImplementation does not exist
And if I remove
mockedAptos = jest.mocked(Aptos);
from line 27, and add the following inside the testsI get a similar error as before:
Type '{ getAccountInfo: Mock<any, any, any>; }' is missing the following properties from type 'Aptos': config, account, ans, coin, and 111 more.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok ! no worries, i'll resolve this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@themooneer can you describe what is that you plan to do? Thanks