Skip to content
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

[Coin Modularization] Tezos #6754

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open

Conversation

sprohaszka-ledger
Copy link
Contributor

@sprohaszka-ledger sprohaszka-ledger commented Apr 25, 2024

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

📝 Description

Tezos in its own package.

The code has also been reorganise to move forward like Polkadot.

Some issue are still to discuss:

  • Tezos Ledger-signer package is used in prepareTransaction
    • Therefore to avoid import ledgerhq/hw-transport an overrides directive has been added to package.json file
  • encodeAddress has "FIXME" to see as previous code didn't pass Typescript strict checking

As a side effect to this PR, SignerContext has been simplified (to be more like the dedicated Bitcoin definition). Remove of the return composition type CoinAddress and CoinSignature as a mandatory declaration.
Thus other coin-modules contains this modification (no impact in their behaviour)

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

Copy link

vercel bot commented Apr 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web-tools ❌ Failed (Inspect) May 7, 2024 5:26pm
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview May 7, 2024 5:26pm
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview May 7, 2024 5:26pm
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview May 7, 2024 5:26pm
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview May 7, 2024 5:26pm

@live-github-bot live-github-bot bot added the common Has changes in live-common label Apr 25, 2024
@live-github-bot live-github-bot bot added desktop Has changes in LLD mobile Has changes in LLM labels Apr 26, 2024
@sprohaszka-ledger sprohaszka-ledger marked this pull request as ready for review April 26, 2024 08:51
@sprohaszka-ledger sprohaszka-ledger requested review from a team as code owners April 26, 2024 08:51
Copy link

socket-security bot commented Apr 26, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@ledgerhq/coin-tezos@0.3.12 None 0 0 B
npm/@types/blake2b@2.1.3 None 0 5.13 kB types

View full report↗︎

gre
gre previously approved these changes Apr 30, 2024
Copy link
Contributor

@gre gre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok for hub scope

@@ -7,7 +7,7 @@ import {
import { SignerContext } from "@ledgerhq/coin-framework/signer";
import type { AccountBridge, Bridge, CurrencyBridge } from "@ledgerhq/types-live";
import getAddressWrapper from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
import type { EvmAddress, EvmSignature, EvmSigner } from "../types/signer";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't modification of coin-evm/* be done in a separated PR? it's no longer a PR about tezos 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote a general comment about this: "As a side effect to this PR, SignerContext has been simplified (to be more like the dedicated Bitcoin definition)".
I might separate it though...

hedi-edelbloute
hedi-edelbloute previously approved these changes May 2, 2024
Copy link

github-actions bot commented May 2, 2024

[Bot] Testing with 'Nitrogen' ❌ 1 txs ($4.87) ⏲ 70.6s

❌ 1 specs have problems: Tezos

What is the bot and how does it work? Everything is documented here!

❌ 1 mutation errors
necessary accounts resynced in 0.28ms
▬ TezosWallet 3.0.3 on nanoS 2.1.0
→ FROM Tezos 1 cross: 5.28869 XTZ (152ops) (tz1aDK1uFAmnUXZ7KJPEmcCEFeYHiVZ56zVF on 44'/1729'/0'/0') tezbox#0 js:2:tezos:0240051fc51799e60dcc8870415b87fc4fd948e71b23fdc0d9b8ac7438cf7d4708:tezbox
max spendable ~5.28775
★ using mutation 'delegate unrevealed'
✔️ transaction 
DELEGATE 0 XTZ
TO tz3LV9aGKHDnAZHCtC9SjNtTrKRu678FqSki
with fees=0.000371
with gasLimit=200
with storageLimit=0
(estimatedFees 0.000745)
STATUS (902ms)
  amount: 0 XTZ
  estimated fees: 0.000745 XTZ
  total spent: 0.000745 XTZ
errors: 
warnings: 
⚠️ Error: device action timeout. Recent events was:
{"text":"Review operation","x":13,"y":17,"w":107,"h":11}
{"text":"Operation (0)","x":26,"y":-1,"w":94,"h":11}
{"text":"Reveal","x":47,"y":10,"w":81,"h":11}
(totally spent 61.5s – ends at 2024-05-02T14:20:40.124Z)
⚠️ 2 spec hints
  • Spec Tezos:
    • mutations should define a test(): send unrevealed, send revealed, send max (non delegating), delegate unrevealed, delegate revealed, undelegate unrevealed, undelegate revealed
    • There are not enough accounts (3) to cover all mutations (7).
      Please increase the account target to at least 8 accounts
Details of the 1 mutations

Spec Tezos (3)

Spec Tezos found 3 Tezos accounts (preload: 231ms). Will use TezosWallet 3.0.3 on nanoS 2.1.0
Tezos 1 cross: 5.28869 XTZ (152ops) (tz1aDK1uFAmnUXZ7KJPEmcCEFeYHiVZ56zVF on 44'/1729'/0'/0') tezbox#0 js:2:tezos:0240051fc51799e60dcc8870415b87fc4fd948e71b23fdc0d9b8ac7438cf7d4708:tezbox
Tezos 2: 0 XTZ (4ops) (tz1he4fPXP3c9fFrztYT3k7KyYuLb28arFNn on 44'/1729'/1'/0') tezbox#1 js:2:tezos:02fe3d777af5380ef0a431c4985772c9669743050cee5feff717c3c3272d7a2810:tezbox
Tezos 3: 0 XTZ (0ops) (tz1SApkt3kmMaqNE1qtgADc6m3B49HZkFVDA on 44'/1729'/2'/0') tezbox#2 js:2:tezos:029d7bcf10737806147b22ba4578747ce4ac53e26b443c9eb1ac0e4d5bfbb8f67e:tezbox
necessary accounts resynced in 0.28ms
▬ TezosWallet 3.0.3 on nanoS 2.1.0
→ FROM Tezos 1 cross: 5.28869 XTZ (152ops) (tz1aDK1uFAmnUXZ7KJPEmcCEFeYHiVZ56zVF on 44'/1729'/0'/0') tezbox#0 js:2:tezos:0240051fc51799e60dcc8870415b87fc4fd948e71b23fdc0d9b8ac7438cf7d4708:tezbox
max spendable ~5.28775
★ using mutation 'delegate unrevealed'
✔️ transaction 
DELEGATE 0 XTZ
TO tz3LV9aGKHDnAZHCtC9SjNtTrKRu678FqSki
with fees=0.000371
with gasLimit=200
with storageLimit=0
(estimatedFees 0.000745)
STATUS (902ms)
  amount: 0 XTZ
  estimated fees: 0.000745 XTZ
  total spent: 0.000745 XTZ
errors: 
warnings: 
⚠️ Error: device action timeout. Recent events was:
{"text":"Review operation","x":13,"y":17,"w":107,"h":11}
{"text":"Operation (0)","x":26,"y":-1,"w":94,"h":11}
{"text":"Reveal","x":47,"y":10,"w":81,"h":11}
(totally spent 61.5s – ends at 2024-05-02T14:20:40.127Z)

Details of the 6 uncovered mutations

Spec Tezos (6)

  • send unrevealed: balance is too low (2)
  • send revealed: balance is too low (2)
  • send max (non delegating): balance is too low (2)
  • delegate revealed: balance is too low (2)
  • undelegate unrevealed: balance is too low (2)
  • undelegate revealed: balance is too low (2)
Portfolio ($4.87) – Details of the 1 currencies
Spec (accounts) State Remaining Runs (est) funds?
Tezos (3) 156 ops , 5.28869 XTZ ($4.87) 👍 182 tz1aDK1uFAmnUXZ7KJPEmcCEFeYHiVZ56zVF
Tezos 1 cross: 5.28869 XTZ (152ops) (tz1aDK1uFAmnUXZ7KJPEmcCEFeYHiVZ56zVF on 44'/1729'/0'/0') tezbox#0 js:2:tezos:0240051fc51799e60dcc8870415b87fc4fd948e71b23fdc0d9b8ac7438cf7d4708:tezbox
Tezos 2: 0 XTZ (4ops) (tz1he4fPXP3c9fFrztYT3k7KyYuLb28arFNn on 44'/1729'/1'/0') tezbox#1 js:2:tezos:02fe3d777af5380ef0a431c4985772c9669743050cee5feff717c3c3272d7a2810:tezbox
Tezos 3: 0 XTZ (0ops) (tz1SApkt3kmMaqNE1qtgADc6m3B49HZkFVDA on 44'/1729'/2'/0') tezbox#2 js:2:tezos:029d7bcf10737806147b22ba4578747ce4ac53e26b443c9eb1ac0e4d5bfbb8f67e:tezbox
Performance ⏲ 70.6s

Time spent for each spec: (total across mutations)

Spec (accounts) preload scan re-sync tx status sign op broadcast test destination test
TOTAL 231ms 3.8s 0.67ms 902ms N/A N/A N/A N/A
Tezos (2) 231ms 3.8s 0.67ms 902ms N/A N/A N/A N/A

What is the bot and how does it work? Everything is documented here!

Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
@live-github-bot live-github-bot bot added the ledgerjs Has changes in the ledgerjs open source libs label May 7, 2024
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
@live-github-bot live-github-bot bot removed the ledgerjs Has changes in the ledgerjs open source libs label May 7, 2024
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Signed-off-by: Stéphane Prohaszka <stephane.prohaszka@ledger.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common desktop Has changes in LLD mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants