Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
poplexity committed Oct 10, 2024
1 parent 79fa958 commit ce3b026
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 4 additions & 1 deletion crates/antelope/src/api/v1/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ impl<T: Provider> ChainAPI<T> {
Err(e) => {
// If parsing the error response also fails, consider it an encoding error
Err(ClientError::ENCODING(EncodingError {
message: format!("Failed to parse response: {} Raw response was: {}", e, result),
message: format!(
"Failed to parse response: {} Raw response was: {}",
e, result
),
}))
}
}
Expand Down
14 changes: 10 additions & 4 deletions crates/antelope/tests/client.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use antelope::api::client::DefaultProvider;

Check warning on line 1 in crates/antelope/tests/client.rs

View workflow job for this annotation

GitHub Actions / Test Suite

unused import: `antelope::api::client::DefaultProvider`

Check warning on line 1 in crates/antelope/tests/client.rs

View workflow job for this annotation

GitHub Actions / Test Suite

unused import: `antelope::api::client::DefaultProvider`
use antelope::api::v1::structs::{ErrorResponse, IndexPosition, SendTransactionResponse, TableIndexType};
use antelope::api::v1::structs::{
ErrorResponse, IndexPosition, SendTransactionResponse, TableIndexType,

Check warning on line 3 in crates/antelope/tests/client.rs

View workflow job for this annotation

GitHub Actions / Test Suite

unused imports: `IndexPosition` and `TableIndexType`

Check warning on line 3 in crates/antelope/tests/client.rs

View workflow job for this annotation

GitHub Actions / Test Suite

unused imports: `IndexPosition` and `TableIndexType`
};
use antelope::{
api::{
client::APIClient,
Expand Down Expand Up @@ -267,13 +269,16 @@ fn test_send_transaction_response() {
"error_code": null
}
}"#;

let parsed = serde_json::from_str::<SendTransactionResponse>(&response_json);
assert!(parsed.is_ok());
let parsed = parsed.unwrap();
let traces = parsed.processed.action_traces;
assert_eq!(traces.len(), 1usize);
assert_eq!(traces.first().unwrap().receipt.global_sequence, 10128941153u64);
assert_eq!(
traces.first().unwrap().receipt.global_sequence,
10128941153u64
);
}

#[test]
Expand Down Expand Up @@ -306,7 +311,8 @@ fn test_error_response_parsing() {
let error_response = parsed_error.expect("Failed to parse JSON");

assert_eq!(
error_response.error.code, Some(3050003),
error_response.error.code,
Some(3050003),
"Error code did not match"
);
assert_eq!(
Expand Down

0 comments on commit ce3b026

Please sign in to comment.