Skip to content

Commit

Permalink
Update dependencies and fix migration to massa v27
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Rey committed Nov 16, 2023
1 parent 4d148bd commit 4f9153d
Show file tree
Hide file tree
Showing 8 changed files with 5,696 additions and 24,067 deletions.
47 changes: 38 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/sc-deployer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@massalabs/as-types": "^1.0.1",
"@massalabs/massa-as-sdk": "^2.4.0",
"@massalabs/massa-sc-compiler": "^0.0.4-dev",
"@massalabs/massa-web3": "^2.2.1",
"@massalabs/massa-web3": "^1.24.3",
"@types/node": "^18.11.10",
"assemblyscript": "^0.25.2",
"rimraf": "^5.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/sc-deployer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async function awaitOperationFinalization(
.smartContracts()
.awaitRequiredOperationStatus(
operationId,
EOperationStatus.FINAL_SUCCESS,
EOperationStatus.SPECULATIVE_SUCCESS,
);
console.log(
`Transaction with Operation ID ${operationId} has reached finality!`,
Expand All @@ -116,7 +116,7 @@ async function awaitOperationFinalization(
throw ex;
}

if (status !== EOperationStatus.FINAL_SUCCESS) {
if (status !== EOperationStatus.SPECULATIVE_SUCCESS) {
let msg = `Transaction ${operationId} did not reach finality after considerable amount of time.`;
msg +=
'Please review the transaction logs to identify potential issues or try redeploying a new contract';
Expand Down
13 changes: 6 additions & 7 deletions packages/sc-deployer/src/utils/maxCoins.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { fromMAS } from '@massalabs/massa-web3';
import { ISCData } from '../interfaces';

const BASE_ACOUNT_CREATION_COST = fromMAS(0.001);
const PRICE_PER_BYTE = fromMAS(0.0001);

import {
BASE_ACCOUNT_CREATION_COST,
STORAGE_BYTE_COST,
} from '@massalabs/massa-web3';
/**
* Estimates the value of the maxCoins maximum number of coins to that should be used while deploying a smart contract.
*
Expand All @@ -17,8 +16,8 @@ export function calculateMaxCoins(
coinsSent: bigint,
) {
return (
BASE_ACOUNT_CREATION_COST +
contractByteCodeSize * PRICE_PER_BYTE +
BASE_ACCOUNT_CREATION_COST +
contractByteCodeSize * STORAGE_BYTE_COST +
coinsSent
);
}
Expand Down
Loading

0 comments on commit 4f9153d

Please sign in to comment.