Skip to content

Commit

Permalink
Buildnet update (#409)
Browse files Browse the repository at this point in the history
* add max_coins (#233)

* little style fix (#234)

* removing esmify (#236)

* update version (#241)

* improved error message (#245)

* 243 testnet 23 objects format changes (#246)

* first changements

* some fixes

* fix buyrolls

* clean

* update version for testnet 23 (#248)

* remove env variables (#244)

* fix powered-by.yml (#239)

* remove fee from IReadData (#253)

* adding EventEmitter polyfill (#265)

* adding EventEmitter polyfill

* handling support of StringDecoder in both browser and node.js

* Generate coverage badge

* [CLEAN] Remove unnecessary else

* [CLEAN] suspend job temporarily

---------

Co-authored-by: massabot <[email protected]>
Co-authored-by: Ben <[email protected]>

* 261 setup test environment (#262)

Co-authored-by: massabot <[email protected]>
Co-authored-by: Senji888 <[email protected]>

* 269 test getBaseAccount, getWalletAccounts (#271)

Co-authored-by: massabot <[email protected]>

* 251 refactor code for testnet 23 (#256)

Co-authored-by: Grégory Libert <[email protected]>

* 273 fix ci (#274)

* Generate coverage badge

* fix  ci (Smart contract example Deploy and Smart contract example Deploy)

---------

Co-authored-by: massabot <[email protected]>

* tests getWalletAccountByAddress, addsecretkeystowallet (#272)

* Generate powered-by

* add u128, u256 serializers (#278)

* add u128, u256 serializers

* Generate coverage badge

* add u128, u256 args support

* Generate coverage badge

* review changes

---------

Co-authored-by: massabot <[email protected]>

* 269 test walletGenerateNewAccount & getAccountFromSecretKey (#279)

* tests walletSignMessage & signMessage (#280)

* walletInfo, removeAddressesFromWallet, cleanWallet (#281)

* walletInfo, removeAddressesFromWallet, cleanWallet

* ci rpc url

* Generate coverage badge

* removing useless test

* fix conflicts

* Generate coverage badge

---------

Co-authored-by: massabot <[email protected]>

* 269 tests getAccountBalance and verifySignature (#282)

* verifySignature test, fix verifySignature and names

* fix signMessage and verifySignature interfaces

* getAccountBalance test

* mock on console.log

* [TEST] skip node dependent test

* Generate coverage badge

---------

Co-authored-by: Ben <[email protected]>
Co-authored-by: massabot <[email protected]>

* add the "getProtoFiles" method to the SmartContractsClient class (#267)

* Generate coverage badge

* Delete test-wallet-example.yml (#289)

* update readSmartContract documentation (#255)

Co-authored-by: Senji888 <[email protected]>

* 284 tests baseclient setProviders, getPrivateProviders & getPublicProviders (#285)

Co-authored-by: Grégory Libert <[email protected]>

* 292 clientFactory unit tests (#294)

* defaultClient factory

* customClientFactory

* Generate coverage badge

* fix sonarcloud

---------

Co-authored-by: massabot <[email protected]>

* 295 unit tests eventpoller (#296)

* setup

* pollEvents test

* emit massa_event_error test

* Generate coverage badge

* timeout test

* fix ci

* setup

* pollEvents test

* emit massa_event_error test

* timeout test

* fix ci

* Generate coverage badge

* Generate coverage badge

* Add console error mock

* Generate coverage badge

* remove useless code mock

* Generate coverage badge

---------

Co-authored-by: massabot <[email protected]>
Co-authored-by: Ben <[email protected]>

* 284 tests baseclient sendJsonRPCRequest (#287)

* getprivateproviders ok

* getpublicproviders ok

* put public fonction instead of protected

* fix setProviders when empty array provided

* setProviders

* Generate coverage badge

* ci testing api

* getProviderForRpcMethod

* put getProviderForRpcMethod public (for testing purpose)

* Generate coverage badge

* adding nock to mock http request

* promisifyJsonRpcCall needs to be fixed

* handle errors from rpc

* fix urls

* Generate coverage badge

* remove old tests which are in other pr

* Generate coverage badge

* fix period offset

* testing protected functions

* Generate coverage badge

* put back protected/private sig

* new tests with private functions

* private signatures for functions

* removing nock

* remove old tests

* api urls

* Generate coverage badge

* private sig

* fix describe name

* add tests missing for coverage

* Generate coverage badge

* mock console.error

* resolve conflicts

* Generate coverage badge

* adding https

* Generate coverage badge

* export requestHeaders

---------

Co-authored-by: massabot <[email protected]>

* Tests walletclient sendtransaction (#311)

* Generate coverage badge

* Generate coverage badge

* add support for u128 and u256 arrays (#299)

* add support for u128 and u256 arrays

* add missing exports

* Generate coverage badge

---------

Co-authored-by: massabot <[email protected]>

* 297 tests eventPoller:  startPolling, stopPolling & compareByThreadAndPeriod (#301)

Co-authored-by: Grégory Libert <[email protected]>

* Generate coverage badge

* 313 tests walletclient buyrolls sellrolls (#314)

* feat(proto):  modifed proto fetcher to generate files in place (#309)

Co-authored-by: Grégory Libert <[email protected]>

* Generate coverage badge

* Test public api client (#319)

* 322 test smartContractsClient: deploySmartcontract (#325)

* 307 tests walletclient addaccountstowallet getwalletaddressesinfo getthreadnumber (#310)

* tests addAccountsToWallet

* Generate coverage badge

* add a waletinfo test

* Generate coverage badge

* getThreadNumber test

* Generate coverage badge

* add tests to walletInfo

* add getwalletaddressesinfo test + clean ts exception

* add final test to getwalletaddressesinfo

* mockData to pass ci

* Generate coverage badge

* fixing conflicts with main

* Generate coverage badge

* Generate coverage badge

* fix retryStrategyOn test

* fix code smell

* fix unnecessary await

* fix test because of code smell changes

* solve conflicts

* Generate coverage badge

* Generate coverage badge

---------

Co-authored-by: massabot <[email protected]>

* 322 test smartContractsClient: callSmartContract (#328)

* fix serialization of string arrays (#316)

* fix serialization of string arrays

* Generate coverage badge

* Generate coverage badge

---------

Co-authored-by: massabot <[email protected]>

* 322 test smartContractsClient: ReadSmartContract (#329)

* ci: support publish for multiple networks (#326)

* fix ci missing branch name (#340)

* fix ci release (#347)

* 322 test smartcontractsclient: getContractBalance & getFilteredScOutputEvents (#330)

* tests smartContractsClient: awaitRequiredOperationStatus (#338)

Co-authored-by: Grégory Libert <[email protected]>

* Remove DS_Store and add to gitignore (#351)

* unit tests for time.ts (#312)

* unit tests for time.ts

* fix
---------

Co-authored-by: massabot <[email protected]>

* clean ci (#355)

* clean ci

* trigger only on main and buildnet

* commit only on main

---------

Co-authored-by: julienbrs <[email protected]>

* fix skipped tests (#356)

* fix skipped tests

---------

Co-authored-by: massabot <[email protected]>

* 346 tests privateapiclient (#348)

Co-authored-by: Grégory Libert <[email protected]>

* encode_decode unit tests (#321)

* encode_decode unit tests

---------

Co-authored-by: massabot <[email protected]>

* tests for client.ts (#353)

Co-authored-by: julienbrs <[email protected]>
Co-authored-by: Grégory Libert <[email protected]>

* 302 unit tests retry execute function (#305)

* added unit tests for retryExecuteFunction.ts

* adding console error mock

* add missing args parameter tests

* fix lint

---------

Co-authored-by: julienbrs <[email protected]>

* Generate coverage badge

* update version (#357)

* SmartContractsClient.ts : getOperationStatus test (#334)

* 358 test smartcontractsclient executereadonlysmartcontract (#359)

Co-authored-by: Grégory Libert <[email protected]>

* Generate coverage badge

* clean SmartContractClient.spec.ts (#364)

* remove warnings

* validSignature mock data

* cleaning

* clean

* add test

* clean mock data

* add tests (#366)

* 370 add more tests for number.ts (#371)

* add tests to catch errors

* fix tests

* fix sonarcloud on privateApiClient spec (#361)

* add tests arrayToBytes & bytesToArray (#369)

* 360 mock tests getaccountbalance + small additional tests (#362)

* Generate coverage badge

* add buildnet in defaultProvider (#372)

* add buildnet in defaultProvider

* add new providers

---------

Co-authored-by: julienbrs <[email protected]>

* add tests (#368)

* fix (and remake) getProtoFiles (#379)

* fix smells and set getProtoFiles to static (#381)

* export PROTO_FILE_SEPARATOR and MASSA_PROTOFILE_KEY (#383)

* add keyAndAddresses test (#385)

* simplify getProtofiles (#388)

* fixed (#389)

* Refactor verifySignature code (#378)

Co-authored-by: Senji888 <[email protected]>
Co-authored-by: Grégory Libert <[email protected]>

* fix rpc uint8array buffer instanciation (#396)

* update getBlocks documentation (#403)

* delete duplicate mock data file (#394)

* delete useless file

* transfer content of deleted file

* new test of wallet operations

* comment rolls test

* Revert "new test of wallet operations"

This reverts commit ad3c880.

* remove getProtoFile (and move it to proto-cli) (#406)

* remove getProtoFile

* Delete MassaProtoFile.ts

* Generate coverage badge

* update version minor (#407)

* update version major (#408)

* update minor version buildnet

---------

Co-authored-by: julienbrs <[email protected]>
Co-authored-by: Adrian C <[email protected]>
Co-authored-by: Nathan HERVIER <[email protected]>
Co-authored-by: massabot <[email protected]>
Co-authored-by: Grégory Libert <[email protected]>
Co-authored-by: Grégory Libert <[email protected]>
Co-authored-by: Pierre Seznec <[email protected]>
Co-authored-by: 0xSwapFeeder <[email protected]>
Co-authored-by: Adrien LF <[email protected]>
Co-authored-by: c1tt1 <[email protected]>
  • Loading branch information
11 people authored Jul 20, 2023
1 parent bd13dd4 commit f7b2ad7
Show file tree
Hide file tree
Showing 39 changed files with 3,874 additions and 560 deletions.
Binary file removed .DS_Store
Binary file not shown.
9 changes: 4 additions & 5 deletions .github/workflows/gen-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ jobs:
mv docs/documentation/html massa-web3
- name: Deploy files
uses: appleboy/scp-action@master
env:
HOST: ${{ secrets.MASSANET_HOST }}
USERNAME: ${{ secrets.MASSANET_USERNAME }}
KEY: ${{ secrets.MASSANET_SSHKEY }}
with:
host: ${{ secrets.MASSANET_HOST }}
username: ${{ secrets.MASSANET_USERNAME }}
key: ${{ secrets.MASSANET_SSHKEY }}
source: "./massa-web3"
target: "/var/www/type-doc"
target: "/var/www/type-doc"
2 changes: 1 addition & 1 deletion .github/workflows/powered-by.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Generate Powered-By
run: |
./generate_powered-by.sh
./scripts/generate_powered-by.sh
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,29 @@ jobs:
npm run test
- name: allow access to coverage.sh
run: chmod +x ${GITHUB_WORKSPACE}/.github/coverage.sh
run: chmod +x ./scripts/coverage.sh
shell: bash

- name: Extract coverage
id: coverage
run: |
value=$(npm run test:cov | awk '/All files/ {print $10}' | tr -d '%')
echo "coverage=$value" >> $GITHUB_OUTPUT
echo "${GITHUB_WORKSPACE}/.github/coverage.sh"
- name: Add test coverage to README
run: ${GITHUB_WORKSPACE}/.github/coverage.sh
run: ./scripts/coverage.sh
shell: bash
env:
COVERAGE: ${{ steps.coverage.outputs.coverage }}

- name: Check if coverage changed
id: check_coverage_changed
run: |
echo "::set-output name=coverage_changed::$(git diff --name-only README.md | grep -E '^README.md$')"
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
if: ${{ github.ref == 'refs/heads/main' && steps.check_coverage_changed.outputs.coverage_changed != '' }}
with:
commit_message: "Generate coverage badge"
file_pattern: "README.md"
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,7 @@ bundle.*
docs

#.env files
.env
.env

# Misc
.DS_Store
3 changes: 3 additions & 0 deletions examples/smartContracts/deployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { EOperationStatus } from '../../src/interfaces/EOperationStatus';
import { Args } from '../../src/utils/arguments';
import { readFileSync } from 'fs';
import { u64ToBytes, u8toByte } from '../../src/utils/serializers';
import { fromMAS } from '../../src';
const path = require('path');
const chalk = require('chalk');

Expand Down Expand Up @@ -72,6 +73,7 @@ export const deploySmartContracts = async (
web3Client: Client,
fee = 0n,
maxGas = 1_000_000n,
maxCoins = fromMAS(0.1),
deployerAccount?: IAccount,
): Promise<string> => {
let deploymentOperationId: string;
Expand Down Expand Up @@ -150,6 +152,7 @@ export const deploySmartContracts = async (
datastore,
fee,
maxGas,
maxCoins,
} as IContractData,
deployerAccount,
);
Expand Down
1 change: 1 addition & 0 deletions examples/smartContracts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ const pollAsyncEvents = async (
web3Client,
0n,
1_000_000n,
fromMAS(0.2),
deployerAccount,
);
spinner.succeed(
Expand Down
Loading

0 comments on commit f7b2ad7

Please sign in to comment.