Skip to content

Commit

Permalink
Merge branch 'main' of github.com:airgap-it/tezos-snaps-wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasGassmann committed Oct 24, 2024
2 parents 904a695 + 563b38e commit 47be010
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/app/components/account/account.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h2 class="card-title">Balance</h2>
class="btn btn-outline-primary btn-circle mr-2"
(click)="
openLink(
'https://widget.wert.io/default/widget/?commodity=XTZ%3ATezos&address=' +
'https://widget.wert.io/01HNMCSXNZFNNFY1KG2ECE95A7/widget/?commodity=XTZ%3ATezos&address=' +
address
)
"
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/operations/operations.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h2 class="card-title">Operations</h2>
class="btn btn-outline-primary btn-circle mr-2"
(click)="
openLink(
'https://widget.wert.io/default/widget/?commodity=XTZ%3ATezos&address=' +
'https://widget.wert.io/01HNMCSXNZFNNFY1KG2ECE95A7/widget/?commodity=XTZ%3ATezos&address=' +
address
)
"
Expand Down
6 changes: 3 additions & 3 deletions src/app/utils/tezos/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const MAX_GAS_PER_BLOCK = 2600000;
export const GAS_LIMIT_PLACEHOLDER = '1040000';
export const STORAGE_LIMIT_PLACEHOLDER = '60000';
export const MAX_GAS_PER_BLOCK = 1733333;
export const GAS_LIMIT_PER_OPERATION = '1040000';
export const STORAGE_LIMIT_PER_OPERATION = '60000';
export const FEE_PLACEHOLDER = '0';

export const DEFAULT_GAS_LIMIT = '10300';
Expand Down
12 changes: 6 additions & 6 deletions src/app/utils/tezos/estimate-fee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
} from './types';
import {
MAX_GAS_PER_BLOCK,
GAS_LIMIT_PLACEHOLDER,
STORAGE_LIMIT_PLACEHOLDER,
GAS_LIMIT_PER_OPERATION,
STORAGE_LIMIT_PER_OPERATION,
FEE_PLACEHOLDER,
MINIMAL_FEE,
MINIMAL_FEE_PER_BYTE,
Expand Down Expand Up @@ -126,14 +126,14 @@ const sumUpFees = async (

if (
((operation as any).gas_limit && overrideParameters) ||
(operation as any).gas_limit === GAS_LIMIT_PLACEHOLDER
(operation as any).gas_limit === GAS_LIMIT_PER_OPERATION
) {
(operation as any).gas_limit = gasLimit.toString();
}

if (
((operation as any).storage_limit && overrideParameters) ||
(operation as any).storage_limit === STORAGE_LIMIT_PLACEHOLDER
(operation as any).storage_limit === STORAGE_LIMIT_PER_OPERATION
) {
(operation as any).storage_limit = storageLimit.toString();
}
Expand Down Expand Up @@ -173,9 +173,9 @@ export const estimateAndReplaceLimitsAndFee = async (
const gasValue = new BigNumber(MAX_GAS_PER_BLOCK).dividedToIntegerBy(
tezosWrappedOperation.contents.length,
);
const gasLimit = new BigNumber(GAS_LIMIT_PLACEHOLDER).gt(gasValue)
const gasLimit = new BigNumber(GAS_LIMIT_PER_OPERATION).gt(gasValue)
? gasValue
: GAS_LIMIT_PLACEHOLDER;
: GAS_LIMIT_PER_OPERATION;
const counter = startingCounter
? startingCounter.plus(i).toString()
: op.counter;
Expand Down
12 changes: 6 additions & 6 deletions src/app/utils/tezos/prepare-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
ALLOCATION_STORAGE_LIMIT,
DEFAULT_GAS_LIMIT,
FEE_PLACEHOLDER,
GAS_LIMIT_PLACEHOLDER,
STORAGE_LIMIT_PLACEHOLDER,
GAS_LIMIT_PER_OPERATION,
STORAGE_LIMIT_PER_OPERATION,
} from './constants';
import { estimateAndReplaceLimitsAndFee } from './estimate-fee';
import { getBalanceOfAddress } from './get-balance-of-address';
Expand Down Expand Up @@ -93,10 +93,10 @@ export const handleTransactionOperation = async (
transactionOperation.counter = transactionOperation.counter ?? defaultCounter;
transactionOperation.fee = transactionOperation.fee ?? defaultFee;
transactionOperation.gas_limit =
transactionOperation.gas_limit ?? GAS_LIMIT_PLACEHOLDER;
transactionOperation.gas_limit ?? GAS_LIMIT_PER_OPERATION;

transactionOperation.storage_limit =
transactionOperation.storage_limit ?? STORAGE_LIMIT_PLACEHOLDER;
transactionOperation.storage_limit ?? STORAGE_LIMIT_PER_OPERATION;

return transactionOperation;
};
Expand All @@ -122,10 +122,10 @@ export const handleOriginationOperation = async (
originationOperation.counter = originationOperation.counter ?? defaultCounter;
originationOperation.fee = originationOperation.fee ?? defaultFee;
originationOperation.gas_limit =
originationOperation.gas_limit ?? GAS_LIMIT_PLACEHOLDER;
originationOperation.gas_limit ?? GAS_LIMIT_PER_OPERATION;

originationOperation.storage_limit =
originationOperation.storage_limit ?? STORAGE_LIMIT_PLACEHOLDER;
originationOperation.storage_limit ?? STORAGE_LIMIT_PER_OPERATION;

return originationOperation;
};
Expand Down

0 comments on commit 47be010

Please sign in to comment.