Skip to content

Fallback to string if bytevector decoding fails #128

Fallback to string if bytevector decoding fails

Fallback to string if bytevector decoding fails #128

GitHub Actions / clippy failed Dec 24, 2024 in 1s

clippy

70 errors

Details

Results

Message level Amount
Internal compiler error 0
Error 70
Warning 0
Note 0
Help 0

Versions

  • rustc 1.83.0 (90b35a623 2024-11-26)
  • cargo 1.83.0 (5ffbef321 2024-10-29)
  • clippy 0.1.83 (90b35a6 2024-11-26)

Annotations

Check failure on line 24 in src/util/sign.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/sign.rs:24:48
   |
24 |   fn check_version(transaction: &Transaction) -> Result<()> {
   |                                                  ^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 16 in src/util/sign.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/sign.rs:16:63
   |
16 |   pub fn sign_order(order: &Order, private_key: &PrivateKey) -> Result<SignedOrder> {
   |                                                                 ^^^^^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 7 in src/util/sign.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/sign.rs:7:72
   |
7  |   pub fn sign_tx(transaction: &Transaction, private_key: &PrivateKey) -> Result<SignedTransaction> {
   |                                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 58 in src/util/json/json_serializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_serializer.rs:58:6
   |
58 |   ) -> Result<Map<String, Value>> {
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 32 in src/util/json/json_serializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_serializer.rs:32:6
   |
32 |   ) -> Result<Map<String, Value>> {
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 24 in src/util/json/json_serializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_serializer.rs:24:66
   |
24 |       pub fn serialize_signed_order(signed_order: &SignedOrder) -> Result<Value> {
   |                                                                    ^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 16 in src/util/json/json_serializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_serializer.rs:16:64
   |
16 |       pub fn serialize_signed_tx(sign_tx: &SignedTransaction) -> Result<Value> {
   |                                                                  ^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 111 in src/util/json/json_deserializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
   --> src/util/json/json_deserializer.rs:111:66
    |
111 |       pub fn asset_id_from_json(json: &Value, field_name: &str) -> Result<Option<AssetId>> {
    |                                                                    ^^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: src/error.rs:62:5
    |
62  | /     UnsupportedTransactionVersion {
63  | |         actual_version: u8,
64  | |         supported_version: u8,
65  | |         tx_type: TransactionData,
66  | |     },
    | |_____- the largest variant contains at least 434 bytes
    |
    = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 103 in src/util/json/json_deserializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
   --> src/util/json/json_deserializer.rs:103:53
    |
103 |       pub fn deserialize_data_array(value: &Value) -> Result<Vec<DataEntry>> {
    |                                                       ^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: src/error.rs:62:5
    |
62  | /     UnsupportedTransactionVersion {
63  | |         actual_version: u8,
64  | |         supported_version: u8,
65  | |         tx_type: TransactionData,
66  | |     },
    | |_____- the largest variant contains at least 434 bytes
    |
    = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 95 in src/util/json/json_deserializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_deserializer.rs:95:43
   |
95 |       pub fn safe_to_array(json: &Value) -> Result<Vec<Value>> {
   |                                             ^^^^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 87 in src/util/json/json_deserializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_deserializer.rs:87:45
   |
87 |       pub fn safe_to_boolean(json: &Value) -> Result<bool> {
   |                                               ^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 79 in src/util/json/json_deserializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_deserializer.rs:79:41
   |
79 |       pub fn safe_to_int(json: &Value) -> Result<i64> {
   |                                           ^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 71 in src/util/json/json_deserializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_deserializer.rs:71:44
   |
71 |       pub fn safe_to_string(json: &Value) -> Result<String> {
   |                                              ^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 61 in src/util/json/json_deserializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_deserializer.rs:61:74
   |
61 |       pub fn safe_to_boolean_from_field(json: &Value, field_name: &str) -> Result<bool> {
   |                                                                            ^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 51 in src/util/json/json_deserializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_deserializer.rs:51:10
   |
51 |       ) -> Result<serde_json::Map<String, Value>> {
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 38 in src/util/json/json_deserializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_deserializer.rs:38:72
   |
38 |       pub fn safe_to_array_from_field(json: &Value, field_name: &str) -> Result<Vec<Value>> {
   |                                                                          ^^^^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 21 in src/util/json/json_deserializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_deserializer.rs:21:70
   |
21 |       pub fn safe_to_int_from_field(json: &Value, field_name: &str) -> Result<i64> {
   |                                                                        ^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 11 in src/util/json/json_deserializer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/json/json_deserializer.rs:11:73
   |
11 |       pub fn safe_to_string_from_field(json: &Value, field_name: &str) -> Result<String> {
   |                                                                           ^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 19 in src/util/hash.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/hash.rs:19:36
   |
19 |       pub fn blake(source: &[u8]) -> Result<Vec<u8>> {
   |                                      ^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 11 in src/util/hash.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/hash.rs:11:42
   |
11 |       pub fn secure_hash(source: &[u8]) -> Result<Vec<u8>> {
   |                                            ^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 53 in src/util/crypto.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/crypto.rs:53:66
   |
53 |       pub fn get_address(chain_id: &u8, public_key_hash: &[u8]) -> Result<Vec<u8>> {
   |                                                                    ^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 48 in src/util/crypto.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/crypto.rs:48:54
   |
48 |       pub fn get_public_key_hash(public_key: &[u8]) -> Result<Vec<u8>> {
   |                                                        ^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 30 in src/util/crypto.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/crypto.rs:30:55
   |
30 |       pub fn get_private_key(account_seed: &Vec<u8>) -> Result<[u8; 32]> {
   |                                                         ^^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 23 in src/util/crypto.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the `Err`-variant returned from this function is very large

error: the `Err`-variant returned from this function is very large
  --> src/util/crypto.rs:23:63
   |
23 |       pub fn get_account_seed(seed_phrase: &[u8], nonce: u8) -> Result<Vec<u8>> {
   |                                                                 ^^^^^^^^^^^^^^^
   |
  ::: src/error.rs:62:5
   |
62 | /     UnsupportedTransactionVersion {
63 | |         actual_version: u8,
64 | |         supported_version: u8,
65 | |         tx_type: TransactionData,
66 | |     },
   | |_____- the largest variant contains at least 434 bytes
   |
   = help: try reducing the size of `error::Error`, for example by boxing large elements or replacing it with `Box<error::Error>`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

Check failure on line 41 in src/util/byte_writer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

error: unneeded `return` statement
  --> src/util/byte_writer.rs:41:13
   |
41 |             return byte_writer.push_byte(0).bytes();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
41 -             return byte_writer.push_byte(0).bytes();
41 +             byte_writer.push_byte(0).bytes()
   |