celestiaorg / cosmos-sdk

:chains: A Framework for Building High Value Public Blockchains :sparkles:
https://cosmos.network/
Other
19 stars 33 forks source link

fix: throw an error if incorrect ledger is used #374

Closed rootulp closed 8 months ago

rootulp commented 8 months ago

Motivated by this Slack thread. This PR is similar to https://github.com/cosmos/cosmos-sdk/pull/19691

codecov-commenter commented 8 months ago

Codecov Report

Attention: Patch coverage is 66.66667% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 64.31%. Comparing base (2a2347c) to head (de7494d).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/celestiaorg/cosmos-sdk/pull/374/graphs/tree.svg?width=650&height=150&src=pr&token=QPoE0e3PbO&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celestiaorg)](https://app.codecov.io/gh/celestiaorg/cosmos-sdk/pull/374?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celestiaorg) ```diff @@ Coverage Diff @@ ## release/v0.46.x-celestia #374 +/- ## ============================================================ - Coverage 64.33% 64.31% -0.02% ============================================================ Files 761 761 Lines 76378 76386 +8 ============================================================ - Hits 49139 49130 -9 - Misses 24463 24481 +18 + Partials 2776 2775 -1 ``` | [Files](https://app.codecov.io/gh/celestiaorg/cosmos-sdk/pull/374?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celestiaorg) | Coverage Δ | | |---|---|---| | [crypto/keyring/keyring.go](https://app.codecov.io/gh/celestiaorg/cosmos-sdk/pull/374?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celestiaorg#diff-Y3J5cHRvL2tleXJpbmcva2V5cmluZy5nbw==) | `63.03% <66.66%> (-0.01%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/celestiaorg/cosmos-sdk/pull/374/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celestiaorg)
rootulp commented 8 months ago

Run unit tests via:

go test ./... -tags "cgo,ledger,test_ledger_mock,norace" -run "TestSignWithLedger"

Add this to your VSCode workspace settings to get rid of gopls errors:

    "go.buildTags": "cgo,ledger,test_ledger_mock,norace",