Skip to content

Commit 7ff41b3

Browse files
imp(02-client): implement TryFrom<TmAbciEvent> for event types (#1253)
* add tryfrom for CreateClient event * add try from for other event and attribute * use ClientError::MissingAttributeKey * refactor error type * add tests * linting, refactor complex type * lint * refactor * lint * refactor * add newline * lint
1 parent f849fbb commit 7ff41b3

File tree

3 files changed

+485
-1
lines changed

3 files changed

+485
-1
lines changed

ibc-core/ics02-client/types/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ tendermint = { workspace = true }
4040
parity-scale-codec = { workspace = true, optional = true }
4141
scale-info = { workspace = true, optional = true }
4242

43+
[dev-dependencies]
44+
rstest = { workspace = true }
45+
4346
[features]
4447
default = [ "std" ]
4548
std = [

ibc-core/ics02-client/types/src/error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ pub enum ClientError {
105105
InvalidUpdateClientMessage,
106106
/// other error: `{description}`
107107
Other { description: String },
108+
/// invalid attribute key: `{attribute_key}`
109+
InvalidAttributeKey { attribute_key: String },
110+
/// invalid attribute value: `{attribute_value}`
111+
InvalidAttributeValue { attribute_value: String },
112+
/// Missing attribute key: `{attribute_key}`
113+
MissingAttributeKey { attribute_key: String },
108114
}
109115

110116
impl From<&'static str> for ClientError {

0 commit comments

Comments
 (0)