mirror of
https://github.com/fluencelabs/aquavm
synced 2025-07-03 16:41:33 +00:00
feat(execution-engine,test-utils,interpreter-data,interpreter-cid)!: Rc into CID (#718)
* Hide `Rc` inside `CID` type, making it cheap to clone. * Introduce `CidRef` type that abstracts on `CID`'s inner type. This change makes code cleaner, makes memory more optimal (single allocation vs two allocations) and makes it easier to change CID's internal representation from string to binary.
This commit is contained in:
@ -14,6 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use std::rc::Rc;
|
||||
|
||||
use air_interpreter_cid::CidRef;
|
||||
use thiserror::Error as ThisError;
|
||||
#[derive(Debug, ThisError)]
|
||||
pub enum DataVerifierError {
|
||||
@ -29,7 +32,7 @@ pub enum DataVerifierError {
|
||||
#[error("signature mismatch for {peer_id:?}: {error:?}, values: CIDS: {cids:?}")]
|
||||
SignatureMismatch {
|
||||
error: Box<fluence_keypair::error::VerificationError>,
|
||||
cids: Vec<Box<str>>,
|
||||
cids: Vec<Rc<CidRef>>,
|
||||
peer_id: String,
|
||||
},
|
||||
|
||||
@ -38,7 +41,7 @@ pub enum DataVerifierError {
|
||||
)]
|
||||
MergeMismatch {
|
||||
peer_id: String,
|
||||
larger_cids: Vec<Box<str>>,
|
||||
smaller_cids: Vec<Box<str>>,
|
||||
larger_cids: Vec<Rc<CidRef>>,
|
||||
smaller_cids: Vec<Rc<CidRef>>,
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user