diff --git a/framework/src/binding/store/mod.rs b/framework/src/binding/store/mod.rs index d669c2ed6..51974e0e3 100644 --- a/framework/src/binding/store/mod.rs +++ b/framework/src/binding/store/mod.rs @@ -12,47 +12,6 @@ pub use array::DefaultStoreArray; pub use map::DefaultStoreMap; pub use primitive::{DefaultStoreBool, DefaultStoreString, DefaultStoreUint64}; -pub struct FixedKeys { - pub inner: Vec, -} - -impl rlp::Encodable for FixedKeys { - fn rlp_append(&self, s: &mut rlp::RlpStream) { - let inner: Vec> = self - .inner - .iter() - .map(|k| k.encode_fixed().expect("encode should not fail").to_vec()) - .collect(); - - s.begin_list(1).append_list::, _>(&inner); - } -} - -impl rlp::Decodable for FixedKeys { - fn decode(r: &rlp::Rlp) -> Result { - let inner_u8: Vec> = rlp::decode_list(r.at(0)?.as_raw()); - - let inner_k: Result, _> = inner_u8 - .into_iter() - .map(|v| <_>::decode_fixed(Bytes::from(v))) - .collect(); - - let inner = inner_k.map_err(|_| rlp::DecoderError::Custom("decode K from bytes fail"))?; - - Ok(FixedKeys { inner }) - } -} - -impl FixedCodec for FixedKeys { - fn encode_fixed(&self) -> ProtocolResult { - Ok(Bytes::from(rlp::encode(self))) - } - - fn decode_fixed(bytes: Bytes) -> ProtocolResult { - Ok(rlp::decode(bytes.as_ref()).map_err(FixedCodecError::from)?) - } -} - pub struct FixedBuckets { pub keys_bucket: Vec>, pub bucket_lens: Vec,