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

fix: Remove support for ledger neuron claiming #236

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Overhauled PEM auth. PEM files are now password-protected by default, and must be used instead of seed files. Passwords can be provided interactively or with `--password-file`. Keys can be generated unencrypted with `quill generate --storage-mode plaintext`, and encrypted keys can be converted to plaintext with `quill decrypt-pem`.
- Overhauled output format. All commands should have human-readable output instead of candid IDL. Candid IDL format can be forced with `--raw`.

- Added support for setting the install mode for UpgradeSnsControlledCanister proposals.
- Removed support for claiming GTC neurons via Ledger devices.

## [0.4.4] - 2024-03-21

Expand Down
19 changes: 0 additions & 19 deletions src/commands/claim_neurons.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#[cfg(feature = "ledger")]
use crate::lib::ledger::LedgerIdentity;
use crate::lib::{
genesis_token_canister_id,
signing::{sign_ingress_with_request_status_query, IngressWithRequestId},
Expand Down Expand Up @@ -27,23 +25,6 @@ pub fn exec(auth: &AuthInfo) -> AnyhowResult<Vec<IngressWithRequestId>> {
sig,
)?])
} else {
#[cfg(feature = "ledger")]
if let AuthInfo::Ledger = auth {
let (_, pk) = LedgerIdentity::new()?.public_key()?;
let sig = Encode!(&hex::encode(pk))?;
Ok(vec![sign_ingress_with_request_status_query(
auth,
genesis_token_canister_id(),
ROLE_NNS_GTC,
"claim_neurons",
sig,
)?])
} else {
Err(anyhow!(
"claim-neurons command requires --pem-file or --ledger to be specified"
))
}
#[cfg(not(feature = "ledger"))]
Err(anyhow!(
"claim-neurons command requires --pem-file to be specified"
))
Expand Down
1 change: 1 addition & 0 deletions src/lib/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ impl LedgerIdentity {
Ok(())
}
/// Gets the public key from the ledger that [`sender`](Self::sender) will return a principal derived from.
#[allow(unused)]
pub fn public_key(&self) -> AnyhowResult<(Principal, Vec<u8>)> {
get_identity(&self.inner.transport.lock().unwrap(), &derivation_path())
.map_err(anyhow::Error::msg)
Expand Down
9 changes: 0 additions & 9 deletions tests/output/ledger/claim_neurons/simple.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/output/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
// Uncomment tests on next ledger app update
ledger_compatible![
account_balance,
claim_neurons,
// claim_neurons,
list_neurons,
// neuron_stake,
public_ids,
Expand Down
Loading