Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: updated ethermint and added CI #29

Merged
merged 8 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Pull request tests
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: large_ubuntu_16
strategy:
matrix:
node-version:
- 18.x
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: pnpm/action-setup@v3
with:
version: 8
- run: cp .env.example .env
- run: pnpm install
- run: pnpm prettier:check
- name: pnpm CI test
run: |
# sometimes not created and is not tailed
touch fhevm.log
pnpm fhevm:start &> fhevm.log &
tail -f fhevm.log | sed '/Starting JSON WebSocket server/ q'
pnpm fhevm:faucet
pnpm test
pnpm fhevm:stop || true
23 changes: 23 additions & 0 deletions .github/workflows/testmock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pull request tests with mocks
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: large_ubuntu_16
strategy:
matrix:
node-version:
- 18.x
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: pnpm/action-setup@v3
with:
version: 8
- run: cp .env.example .env
- run: pnpm install
- run: pnpm prettier:check
- name: pnpm CI test:mock
run: pnpm test:mock
2 changes: 1 addition & 1 deletion .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trailingComma: "all"
overrides:
- files: "*.sol"
options:
compiler: "0.8.17"
compiler: "0.8.22"
parser: "solidity-parse"
tabWidth: 4
- files: "*.ts"
Expand Down
2 changes: 1 addition & 1 deletion contracts/DAO/Comp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ contract Comp is EncryptedERC20, Ownable2Step {
* @notice Construct a new Comp token
*/
constructor() EncryptedERC20("Compound", "COMP") Ownable(msg.sender) {
_mint(1000000);
_mint(1000000, msg.sender);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions contracts/token/ERC20/EncryptedERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ abstract contract EncryptedERC20 is Reencrypt, EncryptedErrors {
}

// Increase sender's balance by the given `amount`.
function _mint(uint64 amount) internal virtual {
balances[msg.sender] = TFHE.add(balances[msg.sender], amount); // overflow impossible because of next line
function _mint(uint64 amount, address to) internal virtual {
balances[to] = TFHE.add(balances[to], amount); // overflow impossible because of next line
_totalSupply = _totalSupply + amount;
emit Mint(msg.sender, amount);
emit Mint(to, amount);
}

// Transfers an encrypted amount from the message sender address to the `to` address.
Expand Down
4 changes: 2 additions & 2 deletions contracts/token/ERC20/extensions/EncryptedERC20Mintable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract EncryptedERC20Mintable is Ownable2Step, EncryptedERC20 {
) Ownable(owner) EncryptedERC20(name_, symbol_) {}

// Increase owner's balance by the given `mintedAmount`.
function mint(uint64 mintedAmount) public virtual onlyOwner {
_mint(mintedAmount);
function mint(uint64 mintedAmount, address to) public virtual onlyOwner {
_mint(mintedAmount, to);
}
}
Loading
Loading