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

Fix: CI pipeline errors #62

Merged
merged 17 commits into from
Nov 18, 2024
16 changes: 12 additions & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,25 @@ jobs:
node-version: ${{ matrix.node }}
cache: yarn

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install dependencies
run: yarn install --immutable

- name: Run hardhat node, deploy contracts (& generate contracts typescript output)
run: yarn chain & yarn deploy
- name: Compile contracts
run: |
cd packages/hardhat
yarn hardhat clean
yarn compile

- name: Run nextjs lint
run: yarn next:lint --max-warnings=0
run: yarn next:lint

- name: Check typings on nextjs
run: yarn next:check-types

- name: Run hardhat lint
run: yarn hardhat:lint --max-warnings=0
run: yarn hardhat:lint
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
"fork": "yarn workspace @fil-frame/hardhat fork",
"generate": "yarn workspace @fil-frame/hardhat run scripts/generateAccount.ts",
"flatten": "yarn workspace @fil-frame/hardhat flatten",
"lint": "yarn workspace @fil-frame/hardhat eslint --config ./.eslintrc.json --ignore-path ./.eslintignore ./*.ts ./deploy/**/*.ts ./scripts/**/*.ts ./test/**/*.ts",
"next:lint": "yarn workspace @fil-frame/hardhat eslint --config ./.eslintrc.json --ignore-path ./.eslintignore ./*.ts ./deploy/**/*.ts ./scripts/**/*.ts ./test/**/*.ts",
"next:check-types": "yarn workspace @fil-frame/nextjs check-types",
"lint-staged": "yarn workspace @fil-frame/hardhat eslint --config ./.eslintrc.json --ignore-path ./.eslintignore",
"format": "yarn workspace @fil-frame/hardhat prettier --write ./*.ts ./deploy/**/*.ts ./scripts/**/*.ts ./test/**/*.ts",
"verify": "yarn workspace @fil-frame/hardhat etherscan-verify",
"hardhat-verify": "yarn workspace @fil-frame/hardhat verify",
"hardhat:lint": "yarn workspace @fil-frame/hardhat lint",
"deploy": "yarn workspace @fil-frame/hardhat deploy",
"deploy:verify": "yarn workspace @fil-frame/hardhat deploy:verify",
"chain": "yarn workspace @fil-frame/hardhat chain",
Expand Down
8 changes: 8 additions & 0 deletions packages/hardhat/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# folders
artifacts
cache
contracts
node_modules/
typechain-types
# files
**/*.json
20 changes: 20 additions & 0 deletions packages/hardhat/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"env": {
"node": true
},
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "off",
"prettier/prettier": [
"warn",
{
"endOfLine": "auto"
}
]
}
}
19 changes: 19 additions & 0 deletions packages/hardhat/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"arrowParens": "avoid",
"printWidth": 120,
"tabWidth": 2,
"trailingComma": "all",
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": true,
"singleQuote": false,
"bracketSpacing": true,
"explicitTypes": "always"
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export const AddressComponent = ({
<div className="bg-base-100 border-base-300 border shadow-md shadow-secondary rounded-3xl px-6 lg:px-8 mb-6 space-y-1 py-4 overflow-x-auto">
<div className="flex">
<div className="flex flex-col gap-1">
<Address address={address} format="long" onlyEnsOrAddress />
<Address address={address as `0x${string}`} format="long" onlyEnsOrAddress />
<div className="flex gap-1 items-center">
<span className="font-bold text-sm">Balance:</span>
<Balance address={address} className="text" />
<Balance address={address as `0x${string}`} className="text" />
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const ContractTabs = ({ address, contractData }: PageProps) => {

useEffect(() => {
const checkIsContract = async () => {
const contractCode = await publicClient.getBytecode({ address: address });
const contractCode = await publicClient.getBytecode({ address: address as `0x${string}` });
setIsContract(contractCode !== undefined && contractCode !== "0x");
};

Expand Down Expand Up @@ -85,8 +85,8 @@ export const ContractTabs = ({ address, contractData }: PageProps) => {
{activeTab === "code" && contractData && (
<AddressCodeTab bytecode={contractData.bytecode} assembly={contractData.assembly} />
)}
{activeTab === "storage" && <AddressStorageTab address={address} />}
{activeTab === "logs" && <AddressLogsTab address={address} />}
{activeTab === "storage" && <AddressStorageTab address={address as `0x${string}`} />}
{activeTab === "logs" && <AddressLogsTab address={address as `0x${string}`} />}
</>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const DealForm = ({
const endEpoch = dealInputs.start_epoch + months * 43200;
handleInputChange({
...e,
// @ts-ignore: number to string conversion
target: { ...e.target, name: "end_epoch", value: endEpoch },
});
};
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/assets/BlueBox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function BlueBox(props) {
export default function BlueBox(props: any) {
return (
<svg
{...props}
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/assets/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function Logo(props) {
export default function Logo(props: any) {
return (
<svg
{...props}
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/assets/LogoLandscape.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function LogoLandscape(props) {
export default function LogoLandscape(props: any) {
return (
<svg
{...props}
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/assets/LogoWithText.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function LogoWithText(props) {
export default function LogoWithText(props: any) {
return (
<svg
{...props}
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/assets/RedArrow.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function RedArrow(props) {
export default function RedArrow(props: any) {
return (
<svg
{...props}
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/assets/RedPopBox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function RedPopBox(props) {
export default function RedPopBox(props: any) {
return (
<svg
{...props}
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/assets/YellowCircle.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function YellowCircle(props) {
export default function YellowCircle(props: any) {
return (
<svg
{...props}
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/svg/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function Logo(props) {
export default function Logo(props: any) {
return (
<svg
{...props}
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/svg/LogoLandscape.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function LogoLandscape(props) {
export default function LogoLandscape(props: any) {
return (
<svg
{...props}
Expand Down
3 changes: 2 additions & 1 deletion packages/nextjs/hooks/lighthouse/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { accessControlConditions } from "../lighthouse/types";
import { generate, recoverKey, recoverShards, saveShards } from "@lighthouse-web3/kavach";
import lighthouse from "@lighthouse-web3/sdk";

type accessControlConditions = any;

export const uploadFilesEncrypted = async (
files: File[],
apiKey: string,
Expand Down
Loading