Skip to content

Commit

Permalink
Merge branch 'master' into mcortesi/foundry
Browse files Browse the repository at this point in the history
  • Loading branch information
soloseng committed Dec 11, 2023
2 parents 16450c6 + 9ab9d00 commit 12635eb
Show file tree
Hide file tree
Showing 270 changed files with 8,109 additions and 11,553 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-jobs-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/contractkit': major
---

Remove Support for deprecated MetaTransactionWallet and MetaTransactionWalletDeployer. IF absolutely needed the contracts can be accessed directly or an alternative such as account abstraction should be used
10 changes: 10 additions & 0 deletions .changeset/cool-waves-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@celo/contractkit': major
---

Remove contracts from lib/generated. now available in @celo/abis package at @celo/abis/web3

If you were directly importing contracts from `@celo/contractkit/lib/generated/*` eg `@celo/lib/generated/Accounts` do a find replace

find: `@celo/contractkit/lib/generated/`
replace: `@celo/abis/web3/`
5 changes: 5 additions & 0 deletions .changeset/few-cycles-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/celocli': patch
---

update terminology: refer to celo not gold.
5 changes: 5 additions & 0 deletions .changeset/light-buses-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/celocli': patch
---

Alias releasecelo to releasegold
6 changes: 6 additions & 0 deletions .changeset/tiny-chairs-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@celo/contractkit': major
'@celo/celocli': major
---

Removes Grandamento from cli and contractkit completely as it has become no op by mento team
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ packages/docs/developer-resources/wallet-remote/reference/**/*.md -diff -merge
packages/docs/developer-resources/wallet-remote/reference/**/*.md linguist-generated=true
packages/docs/developer-resources/wallet-rpc/reference/**/*.md -diff -merge
packages/docs/developer-resources/wallet-rpc/reference/**/*.md linguist-generated=true
packages/docs/command-line-interface/**/*.md -diff -merge
packages/docs/command-line-interface/**/*.md linguist-generated=true
# packages/docs/command-line-interface/**/*.md -diff -merge
# packages/docs/command-line-interface/**/*.md linguist-generated=true
8 changes: 6 additions & 2 deletions .github/workflows/celo-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Get the artifacts to cache
id: get_artifacts_to_cache
run: |
artifacts_to_cache="$(git ls-files --others --ignored --exclude-standard | grep -v node_modules)"
artifacts_to_cache="$(git ls-files --others --ignored --exclude-standard | grep -v node_modules | grep -v .js.map)"
echo "artifacts_to_cache<<EOF" >> $GITHUB_OUTPUT
echo "$artifacts_to_cache" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -357,12 +357,16 @@ jobs:
if [[ $(git status packages/docs/command-line-interface --porcelain) ]]; then
git --no-pager diff packages/docs/command-line-interface
echo "There are git differences after generating CLI docs"
git status
git diff
exit 1
fi
- name: Verify that a new account can be created
run: |
yarn --cwd=packages/cli run celocli account:new
- name: Test that releasecelo command topic is working
run: |
yarn --cwd=packages/cli run celocli releasecelo --help
typescript-tests:
name: Typescript package Tests
runs-on: ['self-hosted', 'monorepo-node18']
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/protocol_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ jobs:
run: forge compile

- name: Run tests
run: forge test -vvv
# can't use gas limit because some setUp function use more than the limit
run: forge test -vvv # --block-gas-limit 20000000
24 changes: 15 additions & 9 deletions .github/workflows/publish-contracts-abi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ jobs:
contents: write
id-token: write
pull-requests: write
repository-projects: write
repository-projects: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Akeyless Get Secrets
id: get_auth_token
uses: docker://us-west1-docker.pkg.dev/devopsre/akeyless-public/akeyless-action:latest
Expand All @@ -47,16 +49,16 @@ jobs:
shell: bash
run: yarn

- name: 'Build all packages'
run: yarn build

- name: Check if a release should be published
# This is what sets the RELEASE_TYPE and RELEASE_VERSION env variables
run: yarn --silent is_contract_release >> "$GITHUB_ENV"
working-directory: packages/protocol
env:
GITHUB_TAG: ${{ github.ref_name }}
INPUT_VERSION: ${{ inputs.npm_version }}

- name: 'Build packages which will not need abis'
shell: bash
run: yarn build --ignore @celo/contractkit --ignore @celo/explorer --ignore @celo/celocli --ignore @celo/governance --ignore @celo/metadata-crawler --ignore @celo/celotool --ignore @celo/env-tests --ignore @celo/transactions-uri --ignore @celo/wallet-rpc --include-dependencies
- name: Compile solidity contracts and typescript files
run: yarn prepare_contracts_and_abis_publishing
working-directory: packages/protocol
Expand All @@ -65,19 +67,23 @@ jobs:
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}

- name: Publish @celo/contracts
run: npm publish $RELEASE_TYPE $DRY_RUN
run: |
cat package.json
npm publish $RELEASE_TYPE $DRY_RUN
working-directory: packages/protocol/contracts
env:
RELEASE_TYPE: ${{ env.RELEASE_TYPE != '' && '--tag $RELEASE_TYPE' || '' }}
RELEASE_TYPE: --tag ${{ env.RELEASE_TYPE != '' && env.RELEASE_TYPE || 'canary' }}
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
DRY_RUN: ${{ env.RELEASE_VERSION == '' && '--dry-run' || '' }}

- name: Publish @celo/abis
run: npm publish $RELEASE_TYPE $DRY_RUN
run: |
cat package.json
npm publish $RELEASE_TYPE $DRY_RUN
working-directory: packages/protocol/abis
env:
RELEASE_TYPE: ${{ env.RELEASE_TYPE != '' && '--tag $RELEASE_TYPE' || '' }}
RELEASE_TYPE: --tag ${{ env.RELEASE_TYPE != '' && env.RELEASE_TYPE || 'canary' }}
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
DRY_RUN: ${{ env.RELEASE_VERSION == '' && '--dry-run' || '' }}
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ packages/protocol/scripts/**/*.js
packages/protocol/migrations/**/*.js
packages/protocol/test/**/*.js
packages/protocol/contractPackages.js

packages/protocol/abis/src-generated/

# prettier eats Latex underscore escapting and doesn't seem to have an option to disable
packages/docs/celo-codebase/protocol/proof-of-stake/epoch-rewards.md
Expand Down
7 changes: 3 additions & 4 deletions packages/celotool/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
"outDir": "lib",
"rootDir": "src",
"baseUrl": ".",
"lib": ["es7", "es2017"],
"target": "es6",
"lib": ["es7", "es2017", "es2020"],
"target": "es2020",
"resolveJsonModule": true,
"esModuleInterop": true,
"paths": {
"@google-cloud/monitoring": ["types/monitoring"]
}
},
"include": ["src", "../contractkit/types"],
"include": ["src"],
"exclude": ["node_modules/"],
"references": [{ "path": "../sdk/utils" }, { "path": "../sdk/contractkit" }]
}
12 changes: 12 additions & 0 deletions packages/cli/dev-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# Developer Guide for CLI

* Things to note *

## Terminology

```
# bin topic command flag
^ ^ ^ ^
celocli governance:show --help
```
8 changes: 6 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"test": "TZ=UTC jest --runInBand"
},
"dependencies": {
"@celo/abis": "10.0.0",
"@celo/base": "^6.0.0",
"@celo/celo-devchain": "^6.0.3-beta.1",
"@celo/connect": "^5.1.1",
"@celo/contractkit": "^5.2.1",
"@celo/explorer": "^5.0.6",
Expand Down Expand Up @@ -73,6 +73,7 @@
"web3": "1.10.0"
},
"devDependencies": {
"@celo/celo-devchain": "^6.0.3",
"@celo/dev-utils": "0.0.1",
"@oclif/dev-cli": "^1.23.0",
"@types/cli-table": "^0.3.0",
Expand Down Expand Up @@ -142,8 +143,11 @@
"node": {
"description": "Manage your Celo node"
},
"releasecelo": {
"description": "View and manage ReleaseGold contracts"
},
"releasegold": {
"description": "View and manage Release Gold contracts"
"description": "Alias for releasecelo"
},
"transfer": {
"description": "Transfer CELO and Celo Dollars"
Expand Down
7 changes: 5 additions & 2 deletions packages/cli/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export abstract class BaseCommand extends Command {
// For commands that don't require the node is synced, add the following line
// to its definition:
// requireSynced = false
public requireSynced: boolean = true
public requireSynced = true

private _web3: Web3 | null = null
private _kit: ContractKit | null = null
Expand Down Expand Up @@ -154,7 +154,10 @@ export abstract class BaseCommand extends Command {
let transport
try {
// Importing for ledger uses only fixes running jest tests
const TransportNodeHid = (await import('@ledgerhq/hw-transport-node-hid')).default
const _TransportNodeHid = (await import('@ledgerhq/hw-transport-node-hid')).default
// types seem to be suggesting 2 defaults but js is otherwise for TransportNodeHid
const TransportNodeHid: typeof _TransportNodeHid.default =
_TransportNodeHid.default || _TransportNodeHid
transport = await TransportNodeHid.open('')
const derivationPathIndexes = res.raw.some(
(value) => (value as any).flag === 'ledgerCustomAddresses'
Expand Down
54 changes: 0 additions & 54 deletions packages/cli/src/commands/grandamento/cancel.test.ts

This file was deleted.

38 changes: 0 additions & 38 deletions packages/cli/src/commands/grandamento/cancel.ts

This file was deleted.

Loading

0 comments on commit 12635eb

Please sign in to comment.