Skip to content

Commit

Permalink
Add unit test to cover the error case
Browse files Browse the repository at this point in the history
  • Loading branch information
AgeManning committed Jun 2, 2024
1 parent f1edf47 commit 32b3e04
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1968,4 +1968,17 @@ mod tests {
record.set_seq(30, &key).unwrap();
assert_eq!(record.seq(), 30);
}

/// Tests a common ENR which uses RLP encoded values without the header
#[test]
fn test_common_rlp_convention() {
const COMMON_VALID_ENR: &str = concat!(
"-LW4QCAyOCtqvQjd8AgpqbaCgfjy8oN8cBBRT5jtzarkGJQWZx1eN70EM0QafVCugLa-Bv493DPNzflagqfTOsWSF78Ih2F0d",
"G5ldHOIAGAAAAAAAACEZXRoMpBqlaGpBAAAAP__________gmlkgnY0hHF1aWOCIymJc2VjcDI1NmsxoQPg_HgqXzwRIK39Oy",
"lGdC30YUFwsfXvATnGUvEZ6MtBQIhzeW5jbmV0cwCDdGNwgiMo"
);

// Expect this to be able to be decoded
let _decoded: DefaultEnr = COMMON_VALID_ENR.parse().unwrap();
}
}

0 comments on commit 32b3e04

Please sign in to comment.