Skip to content

Commit

Permalink
Fix header encoding in UpdateClientEvent according to ibc-rs/informal…
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Aug 8, 2023
1 parent 9db6892 commit 38a827d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/ibc/src/core/ics02_client/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::prelude::*;

use derive_more::From;
use ibc_proto::google::protobuf::Any;
use prost::Message;
use subtle_encoding::hex;
use tendermint_proto::abci;

Expand Down Expand Up @@ -154,9 +155,10 @@ struct HeaderAttribute {

impl From<HeaderAttribute> for abci::EventAttribute {
fn from(attr: HeaderAttribute) -> Self {
let bytes = attr.header.encode_to_vec();
ModuleEventAttribute::from((
HEADER_ATTRIBUTE_KEY,
String::from_utf8(hex::encode(attr.header.value)).unwrap(),
String::from_utf8(hex::encode(bytes)).unwrap(),
))
.into()
}
Expand Down Expand Up @@ -452,7 +454,7 @@ mod tests {
"07-tendermint",
"0-5",
"0-5,0-7",
"0a021005",
"0a102f6962632e6d6f636b2e48656164657212040a021005",
];

let tests: Vec<Test> = vec![
Expand Down

0 comments on commit 38a827d

Please sign in to comment.