Skip to content

Commit

Permalink
Revert "Fix est fee (#314)"
Browse files Browse the repository at this point in the history
This reverts commit e993013.
  • Loading branch information
broody committed May 29, 2024
1 parent e993013 commit 7eaf7b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 7 additions & 3 deletions packages/keychain/src/components/Execute/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export function Execute({
const [ethApproved, setEthApproved] = useState<bigint>();
const [lowEthInfo, setLowEthInfo] = useState<LowEthInfo>();
const [bridging, setBridging] = useState<boolean>(false);
// temporary boosting max fees
// @ts-expect-error there's no setter field for now
const [multiplier, setMultiplier] = useState(2n);

const account = controller.account(chainId);
const calls = useMemo(() => {
Expand Down Expand Up @@ -100,8 +103,8 @@ export function Execute({

if (account.status === Status.DEPLOYED && transactionsDetail.maxFee) {
setFees({
base: BigInt(transactionsDetail.maxFee),
max: BigInt(transactionsDetail.maxFee),
base: BigInt(transactionsDetail.maxFee) * multiplier,
max: BigInt(transactionsDetail.maxFee) * multiplier,
});
return;
}
Expand All @@ -123,7 +126,7 @@ export function Execute({
account
.estimateInvokeFee(calls, transactionsDetail)
.then((fees) => {
setFees({ base: fees.overall_fee, max: fees.suggestedMaxFee });
setFees({ base: fees.overall_fee * multiplier, max: fees.suggestedMaxFee * multiplier });
})
.catch((e) => {
console.error(e);
Expand All @@ -138,6 +141,7 @@ export function Execute({
calls,
chainId,
transactionsDetail,
multiplier
]);

useEffect(() => {
Expand Down
8 changes: 4 additions & 4 deletions packages/keychain/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ const Index: NextPage = () => {
: [transactions];
const policies = calls.map(
(txn) =>
({
target: addAddressPadding(txn.contractAddress),
method: txn.entrypoint,
} as Policy),
({
target: addAddressPadding(txn.contractAddress),
method: txn.entrypoint,
} as Policy),
);

const session = controller.session(origin, cId);
Expand Down

0 comments on commit 7eaf7b0

Please sign in to comment.