Skip to content

Commit 2f877b6

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/replace-ulid-with-uuidv7
2 parents 2fb1abf + 38d0eb7 commit 2f877b6

File tree

3 files changed

+49
-4
lines changed

3 files changed

+49
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313

1414
jobs:
1515
ci:
16-
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.5.0
16+
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.5.1
1717
with:
1818
forge_version: 0.8.0
1919

.github/workflows/generate-allure-report.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ jobs:
2626
- uses: actions/checkout@v4
2727

2828
- name: Install Forge
29-
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.5.0
29+
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.5.1
3030
with:
3131
version: 0.8.0
3232
if: always()
3333

3434
- name: Setup CI
35-
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.5.0
35+
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.5.1
3636

3737
- name: Get catalyst libs unit test report
38-
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.5.0
38+
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.5.1
3939
if: always()
4040
continue-on-error: true
4141
with:

rust/catalyst-types/src/problem_report.rs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ enum Kind {
5555
/// Additional information about the duplicate field.
5656
description: String,
5757
},
58+
/// Conversion error.
59+
ConversionError {
60+
/// The field that failed to convert
61+
field: String,
62+
/// The value that failed to convert
63+
value: String,
64+
/// The type that the value was expected to convert to
65+
expected_type: String,
66+
},
5867
/// An uncategorized problem was encountered. Use only for rare problems, otherwise
5968
/// make a new problem kind.
6069
Other {
@@ -378,6 +387,42 @@ impl ProblemReport {
378387
);
379388
}
380389

390+
/// Reports a conversion error.
391+
///
392+
/// This method adds an entry to the problem report indicating that a field failed to
393+
/// convert to the expected type, along with the value that failed to convert and
394+
/// the expected type.
395+
///
396+
/// # Arguments
397+
///
398+
/// * `field`: A string slice representing the field that failed to convert.
399+
/// * `value`: A string slice representing the value that failed to convert.
400+
/// * `expected_type`: A string slice representing the type that the value was
401+
/// expected to convert to.
402+
///
403+
/// # Example
404+
///
405+
/// ```rust
406+
/// use catalyst_types::problem_report::ProblemReport;
407+
/// let report = ProblemReport::new("RBAC Registration Decoding");
408+
/// report.conversion_error(
409+
/// "address bytes",
410+
/// "[1, 2, 3, 4]",
411+
/// "Address",
412+
/// "RBAC stake address",
413+
/// );
414+
/// ```
415+
pub fn conversion_error(&self, field: &str, value: &str, expected_type: &str, context: &str) {
416+
self.add_entry(
417+
Kind::ConversionError {
418+
field: field.to_owned(),
419+
value: value.to_owned(),
420+
expected_type: expected_type.to_owned(),
421+
},
422+
context,
423+
);
424+
}
425+
381426
/// Reports an uncategorized problem with the given description and context.
382427
///
383428
/// This method is intended for use in rare situations where a specific type of

0 commit comments

Comments
 (0)