Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into controllerabstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Aug 9, 2024
2 parents 258b0da + 8d48306 commit f2f3852
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 83 deletions.
82 changes: 4 additions & 78 deletions packages/account-wasm/pkg/account_wasm_bg.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,47 +35,6 @@ function getUint8Memory0() {
return cachedUint8Memory0;
}

<<<<<<< HEAD
=======
function getStringFromWasm0(ptr, len) {
ptr = ptr >>> 0;
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
}

function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];

heap[idx] = obj;
return idx;
}

function isLikeNone(x) {
return x === undefined || x === null;
}

let cachedFloat64Memory0 = null;

function getFloat64Memory0() {
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
}
return cachedFloat64Memory0;
}

let cachedInt32Memory0 = null;

function getInt32Memory0() {
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
}
return cachedInt32Memory0;
}

let WASM_VECTOR_LEN = 0;

>>>>>>> origin/main
const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;

let cachedTextEncoder = new lTextEncoder('utf-8');
Expand Down Expand Up @@ -132,7 +91,6 @@ function passStringToWasm0(arg, malloc, realloc) {
return ptr;
}

<<<<<<< HEAD
function isLikeNone(x) {
return x === undefined || x === null;
}
Expand Down Expand Up @@ -175,8 +133,6 @@ function getFloat64Memory0() {
return cachedFloat64Memory0;
}

=======
>>>>>>> origin/main
let cachedBigInt64Memory0 = null;

function getBigInt64Memory0() {
Expand Down Expand Up @@ -282,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 @@ -311,13 +267,8 @@ function handleError(f, args) {
wasm.__wbindgen_exn_store(addHeapObject(e));
}
}
<<<<<<< HEAD
function __wbg_adapter_174(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h5ac21e00d5fb0b9f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
=======
function __wbg_adapter_196(arg0, arg1, arg2, arg3) {
wasm.wasm_bindgen__convert__closures__invoke2_mut__h8972e6da137ba7e5(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
>>>>>>> origin/main
wasm.wasm_bindgen__convert__closures__invoke2_mut__h0335efbcd9c8cbfd(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
}

const CartridgeAccountFinalization = (typeof FinalizationRegistry === 'undefined')
Expand Down Expand Up @@ -489,33 +440,22 @@ export function __wbindgen_object_drop_ref(arg0) {
takeObject(arg0);
};

<<<<<<< HEAD
export function __wbindgen_string_get(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'string' ? obj : undefined;
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
=======
export function __wbindgen_error_new(arg0, arg1) {
const ret = new Error(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
>>>>>>> origin/main
};

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

<<<<<<< HEAD
export function __wbindgen_error_new(arg0, arg1) {
const ret = new Error(getStringFromWasm0(arg0, arg1));
=======
export function __wbindgen_string_new(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
>>>>>>> origin/main
return addHeapObject(ret);
};

Expand Down Expand Up @@ -557,15 +497,6 @@ export function __wbindgen_jsval_eq(arg0, arg1) {
return ret;
};

export function __wbindgen_string_get(arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof(obj) === 'string' ? obj : undefined;
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
};

export function __wbindgen_is_object(arg0) {
const val = getObject(arg0);
const ret = typeof(val) === 'object' && val !== null;
Expand Down Expand Up @@ -1071,13 +1002,8 @@ export function __wbindgen_memory() {
return addHeapObject(ret);
};

<<<<<<< HEAD
export function __wbindgen_closure_wrapper2213(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 489, __wbg_adapter_48);
=======
export function __wbindgen_closure_wrapper2238(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 474, __wbg_adapter_48);
>>>>>>> origin/main
export function __wbindgen_closure_wrapper2217(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 488, __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;
8 changes: 5 additions & 3 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,11 +75,11 @@ export function Execute() {

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

if (account.status === Status.DEPLOYED && ctx.transactionsDetail?.maxFee) {
if (isDeployed && ctx.transactionsDetail?.maxFee) {
setFees({
base: BigInt(ctx.transactionsDetail.maxFee),
max: BigInt(ctx.transactionsDetail.maxFee),
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 f2f3852

Please sign in to comment.