pub fn fake_saf_zomes(uid: &str, zomes: Vec<(ZomeName, SafWasm)>) -> SafFile {
    let mut saf = SafDef {
        name: "test".to_string(),
        properties: YamlProperties::new(serde_yaml::from_str("p: hi").unwrap())
            .try_into()
            .unwrap(),
        uid: uid.to_string(),
        zomes: Vec::new(),
    };
    tokio_helper::block_forever_on(async move {
        let mut wasm_code = Vec::new();
        for (zome_name, wasm) in zomes {
            let wasm = crate::saf::wasm::SafWasmHashed::from_content(wasm).await;
            let (wasm, wasm_hash) = wasm.into_inner();
            saf.zomes
                .push((zome_name, ZomeDef::Wasm(WasmZome { wasm_hash })));
            wasm_code.push(wasm);
        }
        SafFile::new(saf, wasm_code).await
    })
    .unwrap()
}
/// A fixture example saf for unit testing.
A fixture example saf for unit testing.
A fixture example saf for unit testing .
pub fn fake_saf_zomes(uid: &str, zomes: Vec<(ZomeName, SafWasm)>) -> SafFile {
    let mut saf = SafDef {
        name: "test".to_string(),
        properties: YamlProperties::new(serde_yaml::from_str("p: hi").unwrap())
            .try_into()
            .unwrap(),
        uid: uid.to_string(),
        zomes: Vec::new(),
    };
    tokio_helper::block_forever_on(async move {
        let mut wasm_code = Vec::new();
        for (zome_name, wasm) in zomes {
            let wasm = crate::saf::wasm::SafWasmHashed::from_content(wasm).await;
            let (wasm, wasm_hash) = wasm.into_inner();
            saf.zomes
                .push((zome_name, ZomeDef::Wasm(WasmZome { wasm_hash })));
            wasm_code.push(wasm);
        }
        SafFile::new(saf, wasm_code).await
    })
    .unwrap()
}
pub fn fake_saf_zomes ( uid : & str , zomes : Vec < ( ZomeName , SafWasm ) > ) -> SafFile { let mut saf = SafDef { name : " " . to_string ( ) , properties : YamlProperties :: new ( serde_yaml :: from_str ( " " ) . unwrap ( ) ) . try_into ( ) . unwrap ( ) , uid : uid . to_string ( ) , zomes : Vec :: new ( ) , } ; tokio_helper :: block_forever_on ( async move { let mut wasm_code = Vec :: new ( ) ; for ( zome_name , wasm ) in zomes { let wasm = crate :: saf :: wasm :: SafWasmHashed :: from_content ( wasm ) . await ; let ( wasm , wasm_hash ) = wasm . into_inner ( ) ; saf . zomes . push ( ( zome_name , ZomeDef :: Wasm ( WasmZome { wasm_hash } ) ) ) ; wasm_code . push ( wasm ) ; } SafFile :: new ( saf , wasm_code ) . await } ) . unwrap ( ) }
A fixture example saf for unit testing.
A fixture example saf for unit testing .
uid
&str
zomes
Vec<(ZomeName, SafWasm)>
uid
&str
zomes
Vec<(ZomeName, SafWasm)>