Skip to content

Conversation

@bertllll
Copy link
Contributor

@bertllll bertllll commented Sep 8, 2025

No description provided.

// Submission error
assert_eq!(
FailureReason::from_str(r#"{"Submission":{"Local":{"Decoder"}}}"#).unwrap(),
FailureReason::from_str(r#"{"Submission":"Decoder"}"#).unwrap(),
Copy link
Collaborator

@utkarshg6 utkarshg6 Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep "Local" here, that's an important thing.

}

let mut hash_map: HashMap<BlockchainErrorKind, ErrorStats> = hashmap!();
loop {
Copy link
Collaborator

@utkarshg6 utkarshg6 Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this, you can do it like this:

       while let Some(entry) = seq.next_element::<EntryOwned>()? {
            hash_map.insert(entry.error_kind, entry.stats);
        }

        Ok(PreviousAttempts { inner: error_stats_map })


#[test]
fn previous_attempts_custom_deserialize_happy_path() {
let str = r#"[{"error":{"AppRpc":"Internal"},"firstSeen":{"secs_since_epoch":1234567890,"nanos_since_epoch":0},"attempts":1}]"#;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too, we're losing the precision here. We also want to know if it's remote or local.


assert_eq!(
result.unwrap_err().to_string(),
"invalid type: string \"Yesterday\", expected struct SystemTime at line 1 column 69"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂

Copy link
Collaborator

@utkarshg6 utkarshg6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@utkarshg6 utkarshg6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@bertllll bertllll marked this pull request as ready for review September 9, 2025 08:57
@bertllll bertllll merged commit 24e0a8a into GH-598 Sep 9, 2025
@bertllll bertllll deleted the GH-598-json-hotfix branch September 19, 2025 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants