Skip to content

Commit

Permalink
fix fmt/clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
broody committed Jun 18, 2024
1 parent 7ed477e commit 6eb96ef
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 31 deletions.
24 changes: 12 additions & 12 deletions packages/account-wasm/pkg/account_wasm_bg.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,6 @@ export function __wbindgen_string_get(arg0, arg1) {
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
};

export function __wbindgen_cb_drop(arg0) {
const obj = takeObject(arg0).original;
if (obj.cnt-- == 1) {
obj.a = 0;
return true;
}
const ret = false;
return ret;
};

export function __wbindgen_bigint_from_u64(arg0) {
const ret = BigInt.asUintN(64, arg0);
return addHeapObject(ret);
Expand All @@ -447,6 +437,16 @@ export function __wbindgen_in(arg0, arg1) {
return ret;
};

export function __wbindgen_cb_drop(arg0) {
const obj = takeObject(arg0).original;
if (obj.cnt-- == 1) {
obj.a = 0;
return true;
}
const ret = false;
return ret;
};

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

export function __wbindgen_closure_wrapper1461(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 464, __wbg_adapter_40);
export function __wbindgen_closure_wrapper1464(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 465, __wbg_adapter_40);
return addHeapObject(ret);
};

Binary file modified packages/account-wasm/pkg/account_wasm_bg.wasm
Binary file not shown.
16 changes: 8 additions & 8 deletions packages/account-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ impl CartridgeAccount {
nonce: SigningKey::from_random().secret_scalar(),
};

// let signed = if let Some(session_details) = from_value(session_details)? {
// self.session_account(session_details)
// .await?
// .sign_outside_execution(outside.clone())
// .await?
// } else {
let signed = self.account.sign_outside_execution(outside.clone()).await?;
//};
let signed = if let Some(session_details) = from_value(session_details)? {
self.session_account(session_details)
.await?
.sign_outside_execution(outside.clone())
.await?
} else {
self.account.sign_outside_execution(outside.clone()).await?
};

let response = PaymasterRequest::send(
self.rpc_url.clone(),
Expand Down
4 changes: 2 additions & 2 deletions packages/account-wasm/src/paymaster.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use reqwest::{Client, Response};
use reqwest::Client;
use serde::{Deserialize, Serialize};
use serde_wasm_bindgen::to_value;
use starknet::core::types::FieldElement;
Expand Down Expand Up @@ -51,7 +51,7 @@ impl PaymasterRequest {
signature,
},
};

let body = stringify(&to_value(&request)?)
.map_err(|_| JsError::new("Error stringifying payload"))?;

Expand Down
5 changes: 1 addition & 4 deletions packages/account-wasm/src/types/call.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use serde::{Deserialize, Serialize};
use starknet::{
accounts::Call,
core::types::FieldElement,
};
use starknet::{accounts::Call, core::types::FieldElement};
use std::str::FromStr;
use wasm_bindgen::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion packages/account-wasm/src/types/outside_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl TryFrom<JsOutsideExecution> for OutsideExecution {
calls: value
.calls
.into_iter()
.map(|c| Call::try_from(c))
.map(Call::try_from)
.collect::<Result<Vec<Call>, _>>()?,
})
}
Expand Down
6 changes: 2 additions & 4 deletions packages/keychain/src/utils/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
BigNumberish,
TransactionFinalityStatus,
InvocationsDetails,
num,
TransactionExecutionStatus,
shortString,
transaction,
Expand All @@ -30,7 +29,7 @@ import { CartridgeAccount } from "@cartridge/account-wasm";
import { Session } from "@cartridge/controller";
import { VERSION } from "./controller";

const EST_FEE_MULTIPLIER = 10n;
const EST_FEE_MULTIPLIER = 2n;

export enum Status {
COUNTERFACTUAL = "COUNTERFACTUAL",
Expand Down Expand Up @@ -170,8 +169,7 @@ class Account extends BaseAccount {

transactionsDetail.nonce =
transactionsDetail.nonce ?? (await this.getNonce("pending"));
//transactionsDetail.maxFee = num.toHex(transactionsDetail.maxFee);
transactionsDetail.maxFee = "0x2386F26FC10000";
transactionsDetail.maxFee = num.toHex(transactionsDetail.maxFee);

const res = await this.cartridge.execute(
transaction.transformCallsToMulticallArrays_cairo1(calls),
Expand Down

0 comments on commit 6eb96ef

Please sign in to comment.