Skip to content

Commit

Permalink
Merge pull request #185 from massalabs/some-improvements
Browse files Browse the repository at this point in the history
various improvements
  • Loading branch information
Thykof authored Dec 21, 2023
2 parents 03efa2f + fd210dd commit 67cb825
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"clean-dist": "rimraf dist/*",
"build-esm": "tsc --project tsconfig.esm.json",
"build-commonjs": "tsc --project tsconfig.commonjs.json",
"build": "npm run fmt && npm-run-all clean-dist build-*",
"build": "npm-run-all clean-dist build-*",
"test-extension:serve-dapp": "cd test-extension/dapp-vite && npm run preview",
"test-extension": "cd ./test-extension && npx playwright test",
"unit-test-commonjs": "jest --config ./jest.config.commonjs.js",
Expand Down
12 changes: 8 additions & 4 deletions src/bearbyWallet/BearbyAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { NodeStatus } from './NodeStatus';
import { JSON_RPC_REQUEST_METHOD } from './jsonRpcMethods';
import axios, { AxiosRequestHeaders, AxiosResponse } from 'axios';
import { IAccountSignOutput } from '../account/AccountSign';
import { isArrayOfNumbers } from '../utils/typeCheck';
/**
* The maximum allowed gas for a read operation
*/
Expand Down Expand Up @@ -193,15 +192,20 @@ export class BearbyAccount implements IAccount {
);
}

let unsafeParameters = Uint8Array.from([]);
if (parameter instanceof Args) {
unsafeParameters = Uint8Array.from(parameter.serialize());
} else {
unsafeParameters = parameter;
}

const operationId = await web3.contract.call({
maxGas: Number(maxGas),
coins: Number(amount),
fee: Number(fee),
targetAddress: contractAddress,
functionName: functionName,
unsafeParameters: isArrayOfNumbers(parameter)
? (parameter as Uint8Array)
: ((parameter as Args).serialize() as unknown as Uint8Array),
unsafeParameters,
});

return { operationId };
Expand Down
2 changes: 1 addition & 1 deletion src/massaStation/MassaStationAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class MassaStationAccount implements IAccount {
nickname: this._name,
name: functionName,
at: contractAddress,
args: args,
args,
coins: Number(coins),
fee: fee ? fee.toString() : '0',
// If maxGas is not provided, estimation will be done by MS
Expand Down
6 changes: 0 additions & 6 deletions src/utils/typeCheck.ts

This file was deleted.

0 comments on commit 67cb825

Please sign in to comment.