Skip to content

Commit

Permalink
clean up fix candid
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs committed Jul 12, 2024
1 parent 39563c2 commit c7ef94d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/compiler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ async function azle(): Promise<void> {
canisterPath
);

// This is for the dfx.json candid property
await writeFile(candidPath, candid);

const compilerInfo: CompilerInfo = {
// The spread is because canisterMethods is a function with properties
canister_methods: {
Expand All @@ -98,6 +95,10 @@ async function azle(): Promise<void> {
canisterPath
);

// This is for the dfx.json candid property
// This must come after generateWasmBinary because it could clear the .azle directory
await writeFile(candidPath, candid);

if (
canisterConfig.build_assets !== undefined &&
canisterConfig.build_assets !== null
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/rust/canister/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ pub extern "C" fn get_js_code() -> Vec<u8> {

#[inline(never)]
#[no_mangle]
extern "C" fn init_wasm_data_passive_data(js_vec_location: i32) -> usize {
"123_456_789".parse::<usize>().unwrap() + js_vec_location as usize // TODO must be like this for weird optimization reasons
extern "C" fn init_wasm_data_passive_data(wasm_data_vec_location: i32) -> usize {
"123_456_789".parse::<usize>().unwrap() + wasm_data_vec_location as usize // TODO must be like this for weird optimization reasons
}

// TODO seems we need to do this to stop the compiler from hard-coding the result of this function where it is called
Expand Down
Binary file modified static_canister_template.wasm
Binary file not shown.

0 comments on commit c7ef94d

Please sign in to comment.