Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 4a808ae

Browse files
committed
improve logs
1 parent 6a2a1c3 commit 4a808ae

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

lib/src/types/ethr.rs

+22-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl EthrBuilder {
221221
}
222222
Attribute::Other(_) => {
223223
log::warn!(
224-
"unhandled or malformed attribute {name}:{}",
224+
"unhandled or malformed attribute name=`{name}`,value=`{}`",
225225
event.value_string_lossy()
226226
)
227227
}
@@ -925,4 +925,25 @@ pub(crate) mod tests {
925925
builder.now(U256::zero());
926926
assert_eq!(builder.also_known_as[0], other);
927927
}
928+
929+
#[test]
930+
fn test_other_attribute() {
931+
let identity = address("0x7e575682a8e450e33eb0493f9972821ae333cd7f");
932+
let event = DidattributeChangedFilter {
933+
name: *b"test/random/attribute99999999 ",
934+
value: b"02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71".into(),
935+
..base_attr_changed(identity, None)
936+
};
937+
938+
let mut builder = EthrBuilder::default();
939+
builder.public_key(&identity).unwrap();
940+
builder.now(U256::zero());
941+
942+
builder.attribute_event(event).unwrap();
943+
944+
let doc = builder.build().unwrap();
945+
946+
// no events should have been registered
947+
assert_eq!(doc.verification_method.len(), 1);
948+
}
928949
}

0 commit comments

Comments
 (0)