Skip to content

Commit

Permalink
Merge pull request #58 from MVPWorkshop/gh-actions
Browse files Browse the repository at this point in the history
[M4] GitHub Actions
  • Loading branch information
snissn authored May 29, 2024
2 parents 2f032e4 + 448eba0 commit a1782be
Show file tree
Hide file tree
Showing 9 changed files with 350 additions and 1,131 deletions.
17 changes: 17 additions & 0 deletions .github/test-api-use/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
node_modules
.env

# Hardhat files
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json

# Hardhat Ignition default folder for deployments against a local node
ignition/deployments/chain-31337
3 changes: 3 additions & 0 deletions .github/test-api-use/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Hardhat project example

Used for testing the API install and imports.
73 changes: 73 additions & 0 deletions .github/test-api-use/contracts/API-Inclusion.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.18;

import {FilAddresses} from "filecoin-solidity-api/contracts/v0.8/utils/FilAddresses.sol";
import {CommonTypes} from "filecoin-solidity-api/contracts/v0.8/types/CommonTypes.sol";

import {AccountTypes} from "filecoin-solidity-api/contracts/v0.8/types/AccountTypes.sol";
import {DataCapTypes} from "filecoin-solidity-api/contracts/v0.8/types/DataCapTypes.sol";
import {MarketTypes} from "filecoin-solidity-api/contracts/v0.8/types/MarketTypes.sol";
import {MinerTypes} from "filecoin-solidity-api/contracts/v0.8/types/MinerTypes.sol";
import {PowerTypes} from "filecoin-solidity-api/contracts/v0.8/types/PowerTypes.sol";
import {VerifRegTypes} from "filecoin-solidity-api/contracts/v0.8/types/VerifRegTypes.sol";

import {AccountAPI} from "filecoin-solidity-api/contracts/v0.8/AccountAPI.sol";
import {DataCapAPI} from "filecoin-solidity-api/contracts/v0.8/DataCapAPI.sol";
import {MarketAPI} from "filecoin-solidity-api/contracts/v0.8/MarketAPI.sol";
import {MinerAPI} from "filecoin-solidity-api/contracts/v0.8/MinerAPI.sol";
import {PowerAPI} from "filecoin-solidity-api/contracts/v0.8/PowerAPI.sol";
import {PrecompilesAPI} from "filecoin-solidity-api/contracts/v0.8/PrecompilesAPI.sol";
import {SendAPI} from "filecoin-solidity-api/contracts/v0.8/SendAPI.sol";
import {VerifRegAPI} from "filecoin-solidity-api/contracts/v0.8/VerifRegAPI.sol";

contract API_Inclusion {
//AccountAPI
function account_authenticate_message(CommonTypes.FilActorId target, AccountTypes.AuthenticateMessageParams memory params) public view {
AccountAPI.authenticateMessage(target, params);
}

//AddressAPI
function actorid_conversion() public pure {
uint64 actorID = 1;
CommonTypes.FilAddress memory result = FilAddresses.fromActorID(actorID);
}
//DatacapAPI
function bundle(DataCapTypes.TransferParams memory params) internal returns (int256, DataCapTypes.TransferReturn memory) {
DataCapAPI.name();
DataCapAPI.symbol();
}

//MarketAPI
function withdraw_balance(MarketTypes.WithdrawBalanceParams memory params) public returns (CommonTypes.BigInt memory) {
(int256 exit_code, CommonTypes.BigInt memory result) = MarketAPI.withdrawBalance(params);

return result;
}

//MinerAPI
function get_owner(CommonTypes.FilActorId target) external view returns (int256, MinerTypes.GetOwnerReturn memory) {
MinerAPI.getOwner(target);
}

//PowerAPI
function create_miner(PowerTypes.CreateMinerParams memory params, uint256 value) internal returns (int256, PowerTypes.CreateMinerReturn memory) {
PowerAPI.createMiner(params, value);
}

//PrecompilesAPI
function resolve_address(CommonTypes.FilAddress memory addr) internal view returns (uint64) {
PrecompilesAPI.resolveAddress(addr);
}

//SendAPI
function send(CommonTypes.FilAddress memory target, uint256 value) internal returns (int256) {
SendAPI.send(target, value);
}

//VerifregAPI
function remove_expired_claims(
VerifRegTypes.RemoveExpiredClaimsParams memory params
) public returns (int256, VerifRegTypes.RemoveExpiredClaimsReturn memory) {
VerifRegAPI.removeExpiredClaims(params);
}
}
6 changes: 6 additions & 0 deletions .github/test-api-use/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require("@nomicfoundation/hardhat-toolbox")

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.18",
}
33 changes: 33 additions & 0 deletions .github/test-api-use/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "fil-sol-use",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-ignition": "^0.15.4",
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.0",
"@typechain/ethers-v6": "^0.5.0",
"@typechain/hardhat": "^9.0.0",
"@types/mocha": ">=9.1.0",
"chai": "^4.2.0",
"hardhat": "^2.22.4",
"hardhat-gas-reporter": "^1.0.8",
"solidity-coverage": "^0.8.1",
"ts-node": ">=8.0.0",
"typechain": "^8.3.0",
"typescript": ">=4.5.0"
},
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^5.0.0"
}
}
Loading

0 comments on commit a1782be

Please sign in to comment.