pub type Bytes = Vec<u8>;
#[derive(Debug, Clone)]
pub struct StateProof {
address: Address,
account_proof: Vec<Bytes>,
key: H256,
value_proof: Vec<Bytes>,
}
impl Encodable for StateProof {
fn rlp_append(&self, s: &mut RlpStream) {
s.begin_list(4);
s.append(&self.address);
s.append_list(&self.account_proof);
s.append(&self.key);
s.append_list(&self.value_proof);
}
}
impl Decodable for StateProof {
fn decode(rlp: &UntrustedRlp) -> Result<Self, DecoderError> {
Ok(StateProof {
address: rlp.val_at(0)?,
account_proof: rlp.list_at(1)?,
key: rlp.val_at(2)?,
value_proof: rlp.list_at(3)?,
})
}
}
Error Info:
|
17 | s.append_list(&self.account_proof);
| ^^^^^^^^^^^ cannot infer type for `E`
=
I have no idea why this error happened.
Rlp Encode have implemented encodable
trait for Vec<u8>
.