Skip to content

Commit

Permalink
Fix execute error after immediate deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
broody committed Aug 9, 2024
1 parent 8284b92 commit e036d39
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
18 changes: 9 additions & 9 deletions packages/account-wasm/pkg/account_wasm_bg.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
return real;
}
function __wbg_adapter_48(arg0, arg1, arg2) {
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h39428d3e77f48435(arg0, arg1, addHeapObject(arg2));
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h157e462b0b279b36(arg0, arg1, addHeapObject(arg2));
}

let cachedUint32Memory0 = null;
Expand Down Expand Up @@ -268,7 +268,7 @@ function handleError(f, args) {
}
}
function __wbg_adapter_196(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h8972e6da137ba7e5(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
wasm.wasm_bindgen__convert__closures__invoke2_mut__h0335efbcd9c8cbfd(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
}

const CartridgeAccountFinalization = (typeof FinalizationRegistry === 'undefined')
Expand Down Expand Up @@ -445,11 +445,6 @@ export function __wbindgen_error_new(arg0, arg1) {
return addHeapObject(ret);
};

export function __wbindgen_object_clone_ref(arg0) {
const ret = getObject(arg0);
return addHeapObject(ret);
};

export function __wbindgen_string_new(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
Expand Down Expand Up @@ -513,6 +508,11 @@ export function __wbindgen_bigint_from_u64(arg0) {
return addHeapObject(ret);
};

export function __wbindgen_object_clone_ref(arg0) {
const ret = getObject(arg0);
return addHeapObject(ret);
};

export function __wbindgen_jsval_loose_eq(arg0, arg1) {
const ret = getObject(arg0) == getObject(arg1);
return ret;
Expand Down Expand Up @@ -1068,8 +1068,8 @@ export function __wbindgen_memory() {
return addHeapObject(ret);
};

export function __wbindgen_closure_wrapper2238(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 474, __wbg_adapter_48);
export function __wbindgen_closure_wrapper2257(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 477, __wbg_adapter_48);
return addHeapObject(ret);
};

Binary file modified packages/account-wasm/pkg/account_wasm_bg.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/account-wasm/pkg/account_wasm_bg.wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function cartridgeaccount_delegateAccount(a: number): number;
export function __wbindgen_malloc(a: number, b: number): number;
export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
export const __wbindgen_export_2: WebAssembly.Table;
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h39428d3e77f48435(a: number, b: number, c: number): void;
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h157e462b0b279b36(a: number, b: number, c: number): void;
export function __wbindgen_add_to_stack_pointer(a: number): number;
export function __wbindgen_exn_store(a: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h8972e6da137ba7e5(a: number, b: number, c: number, d: number): void;
export function wasm_bindgen__convert__closures__invoke2_mut__h0335efbcd9c8cbfd(a: number, b: number, c: number, d: number): void;
6 changes: 4 additions & 2 deletions packages/keychain/src/components/Execute/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ import { ExecuteCtx } from "utils/connection";
import { TransferAmountExceedsBalance } from "errors";
import { ETH_MIN_PREFUND } from "utils/token";
import { num } from "starknet";
import { useDeploy } from "hooks/deploy";

export const CONTRACT_ETH =
"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7";

export function Execute() {
const { chainId, controller, context, origin, cancel } = useConnection();
const { isDeployed } = useDeploy();
const ctx = context as ExecuteCtx;

const [fees, setFees] = useState<{
Expand Down Expand Up @@ -73,7 +75,7 @@ export function Execute() {

// Estimate fees
useEffect(() => {
if (!controller || !calls) {
if (!controller || !calls || !isDeployed) {
return;
}

Expand All @@ -99,7 +101,7 @@ export function Execute() {

setError(e);
});
}, [origin, account, controller, setError, setFees, calls, chainId, ctx]);
}, [origin, account, controller, setError, setFees, calls, chainId, ctx, isDeployed]);

useEffect(() => {
if (!ethBalance || !fees) {
Expand Down

0 comments on commit e036d39

Please sign in to comment.