1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-20 21:38:26 +00:00
trezor-firmware/rust/trezor-client
Roman Zeyde 3d356b25ab fix(rust/trezor-client): update sign_message example
The existing code seems to fail with Model T 2.6.0:

```
2023-11-25T15:52:06.035004Z TRACE trezor_client::client: Sending MessageType_SignMessage msg: SignMessage { address_n: [2147483648, 2147483648, 2147483649], message: Some([114, 101, 103, 101, 108, 32, 104, 101, 116]), coin_name: Some("Testnet"), script_type: Some(SPENDADDRESS), no_script_type: None, chunkify: None, special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } }
2023-11-25T15:52:06.413333Z DEBUG trezor_client::client: Received failure: Failure { code: Some(Failure_DataError), message: Some("Forbidden key path"), special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } }
thread 'main' panicked at examples/sign_message.rs:10:49:
called `Result::unwrap()` on an `Err` value: FailureResponse(Failure { code: Some(Failure_DataError), message: Some("Forbidden key path"), special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } })
```

Also, use `handle_interaction` from `trezor_client::client::common` to
simplify the example.
2023-11-28 09:55:39 +01:00
..
build feat(rust): move trezor-client build script to separate crate (#3154) 2023-09-29 20:13:00 +02:00
examples fix(rust/trezor-client): update sign_message example 2023-11-28 09:55:39 +01:00
scripts chore: re-generate bindings 2023-11-27 11:19:48 +01:00
src chore: re-generate bindings 2023-11-27 11:19:48 +01:00
.clippy.toml feat(rust): add trezor-client crate 2023-07-11 13:50:33 +02:00
.gitignore feat(rust): add trezor-client crate 2023-07-11 13:50:33 +02:00
Cargo.lock chore: re-generate bindings 2023-11-27 11:19:48 +01:00
Cargo.toml chore: re-generate bindings 2023-11-27 11:19:48 +01:00
LICENSE feat(rust): add trezor-client crate 2023-07-11 13:50:33 +02:00
README.md docs(rust/trezor-client): update readme 2023-08-10 10:10:51 +02:00
rustfmt.toml feat(rust): add trezor-client crate 2023-07-11 13:50:33 +02:00

trezor-client

Downloads License [![CI Status][actions-badge]][actions-url]

A fork of a fork of a library that provides a way to communicate with a Trezor T device from a Rust project.

Previous iterations provided implementations for Bitcoin only. This crate also provides an Ethereum interface, mainly for use in ethers-rs.

Requirements

MSRV: 1.60

See the Trezor guide on how to install and use the Trezor Suite app.

Last tested with firmware v2.4.2.

Examples / Tests

cargo run --example features

Features

  • bitcoin and ethereum: client implementation and full support;
  • cardano, monero, nem, ripple, stellar and tezos: only protobuf bindings.

Credits