Skip to content

Commit 9897f9c

Browse files
committed
chore(kms-connector): update extra_data encoding
1 parent de1a04c commit 9897f9c

File tree

1 file changed

+5
-7
lines changed
  • kms-connector/crates/kms-worker/src/core/event_processor

1 file changed

+5
-7
lines changed

kms-connector/crates/kms-worker/src/core/event_processor/decryption.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,8 @@ impl DecryptionProcessor {
145145
}
146146

147147
fn decode_s3_url_matrix(extra_data: &[u8]) -> anyhow::Result<Vec<Vec<String>>> {
148-
let Some(encoded_urls) = extra_data.get(1..) else {
149-
return Err(anyhow!("No encoded urls in extra_data: {extra_data:?}"));
150-
};
151-
Ok(SolValue::abi_decode(encoded_urls)?)
148+
let (_version, urls): (u32, Vec<Vec<String>>) = SolValue::abi_decode_sequence(extra_data)?;
149+
Ok(urls)
152150
}
153151

154152
pub struct UserDecryptionExtraData {
@@ -195,9 +193,9 @@ mod tests {
195193
// string[][] memory url_matrix = new string[][](2);
196194
// url_matrix[0] = url_array1;
197195
// url_matrix[1] = url_array2;
198-
// uint8 version = 1;
199-
// return bytes.concat(bytes1(version), abi.encode(url_matrix));
196+
// uint32 version = 1;
197+
// return abi.encode(version, url_matrix);
200198
// }
201199
// ```
202-
const REMIX_GENERATED_EXTRA_DATA: &str = "0x0100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000010687474703a2f2f6c6f63616c686f737400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001568747470733a2f2f3132372e302e302e313a38302f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000018687474703a2f2f6c6f63616c686f73743a38312f746573740000000000000000";
200+
const REMIX_GENERATED_EXTRA_DATA: &str = "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000010687474703a2f2f6c6f63616c686f737400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001568747470733a2f2f3132372e302e302e313a38302f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000018687474703a2f2f6c6f63616c686f73743a38312f746573740000000000000000";
203201
}

0 commit comments

Comments
 (0)