Skip to content

Commit fa38757

Browse files
refactor(coin-evm): remove some dead code
1 parent 1102608 commit fa38757

File tree

21 files changed

+125
-1395
lines changed

21 files changed

+125
-1395
lines changed

.changeset/lazy-mayflies-itch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ledgerhq/coin-evm": major
3+
---
4+
5+
refactor(coin-evm): remove dead code

libs/coin-modules/coin-evm/docs/adapters.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ Set of functions in charge of converting a transaction format specific to a libr
33

44
## Files
55

6-
#### ethers.ts
7-
Functions used to convert transactions for the [ethers.js v6 library](https://docs.ethers.org/v6/)
8-
96
#### etherscan.ts
107
Functions used to convert transactions coming from the [etherscan-like explorers](https://docs.etherscan.io/api-endpoints/accounts)
118

129
#### ledger.ts
13-
Functions used to convert transactions coming from the [Ledger explorers](https://explorers.api.live.ledger.com/blockchain/v4/eth/docs/#/address/Transactions%20by%20address)
10+
Functions used to convert transactions coming from the [Ledger explorers](https://explorers.api.live.ledger.com/blockchain/v4/eth/docs/#/address/Transactions%20by%20address)

libs/coin-modules/coin-evm/docs/logic.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ Set of helpers for the whole coin-evm module.
33

44
## Methods
55

6-
#### legacyTransactionHasFees
7-
Simple function to verify the presence of key and values specific to transactions of type 0 and 1 (not type 2 / EIP-1559).
8-
9-
#### eip1559TransactionHasFees
10-
Simple function to verify the presence of key and values specific to transactions of type 2 (not type 0/Legacy or type 1/EIP-2930).
11-
126
#### getGasLimit
137
Helper return the gas limit of a transaction, either customized by the user or the default one.
148

@@ -29,16 +23,8 @@ Helper working with the idea of maintaining the javascript memory references of
2923
Method creating a hash that will help triggering or not a full synchronization on an account.
3024
Modifying the result of this method will force every ledger live account to do at least 1 full synchronization the next time they use this lib.
3125

32-
#### attachOperations
33-
Helper in charge of linking operations together based on transaction hash. Token operations & NFT operations are the result of a coin operation and if this coin operation is originated by our user we want to link those operations together as main & children operations.
34-
A sub operation should always be linked to a coin operation, even if the user isn't at the origin of the sub operation. "NONE" type coin operations can be added when necessary.
35-
⚠️ If an NFT operation was found without a coin parent operation just like if it was not initiated by the synced account and we were to find that coin operation during another sync, the NONE operation created would not be removed, creating a duplicate that will cause issues regarding NFT balances & React key duplications.
36-
37-
#### isNftTransaction
38-
Type gard method narrowing NFT related transactions.
39-
4026
#### padHexString
4127
Add necessary "0" in a hexadecimal string in order to make its character an even number, which can be necessary to some implementations. (e.g. 0x123 => 0x0123)
4228

4329
#### getMessageProperties
44-
Function returning the properties that will be displayed on the nano in order to sign it, based on the message type/standard.
30+
Function returning the properties that will be displayed on the nano in order to sign it, based on the message type/standard.

libs/coin-modules/coin-evm/docs/transaction.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,5 @@ This serializer transforms a stringified transaction into a hydrated transaction
2020
##### toTransactionRaw <sub><sup><sub><sup>[standard]</sup><sub></sup><sub>
2121
This serializer transforms a stringified transaction into a hydrated transaction.
2222

23-
##### getTransactionData
24-
This method returns the *callData* of a smart contract transaction when crafted with a transaction mode (`send` mode can be coins or ERC20 transactions, while `erc721` & `erc1155` modes are NFT transactions).
25-
2623
##### getTypedTransaction
2724
[EIP-2718](https://eips.ethereum.org/EIPS/eip-2718 "eip-2718") defines the capacity of a transaction to have different types, which can introduce new properties compared to the legacy definition. This method acts as a type guard for a transaction, depending on its type, to ensure that you're interacting with a transaction that has all the necessary properties for the [RLP encoding](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/ "RLP encoding") to work correctly. As of today, only type 0 (legacy) and type 2 ([EIP-1559](https://eips.ethereum.org/EIPS/eip-1559 "EIP-1559")) transactions are supported. Type 1 ([EIP-2930](https://eips.ethereum.org/EIPS/eip-2930 "EIP-2930")) is compatible but does not add any access lists.
28-
29-
30-
##### getSerializedTransaction
31-
This method returns an [RLP encoding](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/ "RLP encoding") hexadecimal string representation of the provided transaction.

libs/coin-modules/coin-evm/src/adapters/ethers.test.ts

Lines changed: 0 additions & 131 deletions
This file was deleted.

libs/coin-modules/coin-evm/src/adapters/ethers.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* istanbul ignore file: pure exports, bridge tested by live-common with bridge.integration.test.ts */
22

3-
export * from "./ethers";
43
export * from "./ledger";
54
export * from "./etherscan";
65
export * from "./blockOperations";

libs/coin-modules/coin-evm/src/errors.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const InvalidExplorerResponse = createCustomErrorClass("InvalidExplorerRe
1616
// Node
1717
export const UnknownNode = createCustomErrorClass("UnknownNode");
1818
export const LedgerNodeUsedIncorrectly = createCustomErrorClass("LedgerNodeUsedIncorrectly");
19-
export const ExternalNodeUsedIncorrectly = createCustomErrorClass("ExternalNodeUsedIncorrectly");
2019
export const UnsupportedRpcMethodError = createCustomErrorClass<{
2120
method: string;
2221
rawError: unknown;
@@ -35,4 +34,3 @@ export const InsufficientFunds = createCustomErrorClass("InsufficientFunds");
3534
// Nfts
3635
export const NotOwnedNft = createCustomErrorClass("NotOwnedNft");
3736
export const NotEnoughNftOwned = createCustomErrorClass("NotEnoughNftOwned");
38-
export const QuantityNeedsToBePositive = createCustomErrorClass("QuantityNeedsToBePositive");

0 commit comments

Comments
 (0)