Skip to content

Commit

Permalink
Merge branch 'dev' into snax-chain-color
Browse files Browse the repository at this point in the history
  • Loading branch information
saeta-eth committed Oct 2, 2024
2 parents 131ce31 + b4a408a commit ba223fa
Show file tree
Hide file tree
Showing 24 changed files with 1,042 additions and 519 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/check-branch-name.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ jobs:
switch(base) {
case 'main':
case 'alpha': {
if (!/^hotfix\/[a-z0-9-_]+$/.test(branch)) {
if (!/^hotfix\/[A-Za-z0-9-_\.]+$/.test(branch)) {
console.error(`::error::Branch name must start with 'hotfix/*' for PRs to ${base}`)
process.exit(1)
}
break;
}
case 'dev': {
if (!/^(feat|fix|chore|docs|test)\/[a-z0-9-_]+$/.test(branch)) {
if (!/^(feat|fix|chore|docs|test)\/[A-Za-z0-9-_\.]+$/.test(branch)) {
console.error(`::error::Branch name must start with '(feat|fix|chore|docs|test)/*' for PRs to ${base}`)
process.exit(1)
}
break;
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ jspm_packages/
# local env vars
.env.local

# nx
# nx cache folder
.nx
2 changes: 1 addition & 1 deletion examples/sample-hardhat-toolbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"hardhat": "^2.19.2",
"hardhat-cannon": "workspace:*",
"viem": "^2.16.5"
"viem": "^2.21.15"
}
}
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"helmet": "^7.1.0",
"prom-client": "^15.1.2",
"redis": "^4.6.13",
"viem": "^2.16.5"
"viem": "^2.21.15"
},
"devDependencies": {
"@types/cors": "^2.8.17",
Expand Down
2 changes: 1 addition & 1 deletion packages/builder/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

export default {
testTimeout: 15000,
testTimeout: 30000,

// All imported modules in your tests should be mocked automatically
// automock: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"pako": "^2.1.0",
"promise-events": "^0.2.4",
"typestub-ipfs-only-hash": "^4.0.0",
"viem": "^2.16.5",
"viem": "^2.21.15",
"zod": "^3.23.6"
},
"engines": {
Expand Down
6 changes: 6 additions & 0 deletions packages/builder/src/ipfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ export async function getContentCID(value: string | Buffer): Promise<string> {
return Hash.of(value);
}

export async function getContentUrl(content?: any): Promise<string | null> {
if (!content) return null;
const buffer = compress(JSON.stringify(content));
return 'ipfs://' + (await getContentCID(Buffer.from(buffer)));
}

export function setAxiosRetries(totalRetries = 3) {
axiosRetry(axios, {
retries: totalRetries,
Expand Down
9 changes: 8 additions & 1 deletion packages/builder/src/steps/clone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
PackageState,
} from '../types';
import { template } from '../utils/template';
import { getContentUrl } from '../ipfs';

const debug = Debug('cannon:builder:clone');

Expand Down Expand Up @@ -238,7 +239,7 @@ const cloneSpec = {
};
}

const newMiscUrl = await importRuntime.recordMisc();
const newMiscUrl = await getContentUrl(importRuntime.misc);

debug(`[clone.${importLabel}]`, 'new misc:', newMiscUrl);

Expand All @@ -256,6 +257,12 @@ const cloneSpec = {
chainId: runtime.chainId,
});

const uploadedMiscUrl = await importRuntime.recordMisc();

if (newMiscUrl && newMiscUrl !== uploadedMiscUrl) {
throw new Error(`Misc url mismatch: ${newMiscUrl} | ${uploadedMiscUrl}`);
}

if (!newSubDeployUrl) {
debug(`[clone.${importLabel}]`, 'warn: cannot record built state for import nested state');
} else {
Expand Down
3 changes: 2 additions & 1 deletion packages/builder/src/steps/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ const deploySpec = {
},

getOutputs(_: Config, packageState: PackageState) {
return [`contracts.${packageState.currentLabel.split('.')[1]}`, `${packageState.currentLabel.split('.')[1]}`];
const stepName = packageState.currentLabel.split('.')[1];
return [`contracts.${stepName}`, stepName];
},

async exec(
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"table": "^6.8.2",
"tildify": "3.0.0",
"untildify": "^4.0.0",
"viem": "^2.16.5",
"viem": "^2.21.15",
"znv": "^0.4.0",
"zod": "^3.23.8"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/hardhat-cannon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"chalk": "^4.1.2",
"debug": "^4.3.6",
"fs-extra": "^11.2.0",
"viem": "^2.16.5"
"viem": "^2.21.15"
},
"gitHead": "81979336c4cfe5f1f8ee7677b2b968f886a20a87"
}
2 changes: 1 addition & 1 deletion packages/indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"envalid": "^8.0.0",
"lodash": "^4.17.21",
"redis": "^4.6.13",
"viem": "^2.16.5"
"viem": "^2.21.15"
},
"devDependencies": {
"@types/connect-busboy": "^1.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"remark-gfm": "^3.0.1",
"simple-url": "^1.1.8",
"styled-components": "^6.0.7",
"viem": "2.16.5",
"viem": "^2.21.15",
"wagmi": "^2.5.13",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.21.4",
Expand Down
16 changes: 12 additions & 4 deletions packages/website/src/components/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,30 @@ import {

type Props = {
status?: 'info' | 'success' | 'error' | 'warning';
borderless?: boolean;
title?: string;
children: ReactNode;
children?: ReactNode;
} & ChakraAlertProps;

export function Alert({ status = 'info', title, children, ...rest }: Props) {
export function Alert({
status = 'info',
borderless,
title,
children,
...rest
}: Props) {
return (
<ChakraAlert
status={status}
bg="gray.800"
border="1px solid"
border={borderless ? 'none' : '1px solid'}
px={borderless ? '0' : '4'}
borderColor="gray.700"
{...rest}
>
<AlertIcon />
{title && <AlertTitle>{title}</AlertTitle>}
<AlertDescription>{children}</AlertDescription>
{children && <AlertDescription>{children}</AlertDescription>}
</ChakraAlert>
);
}
2 changes: 1 addition & 1 deletion packages/website/src/features/Deploy/NoncePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function NoncePicker({ safe, handleChange }: Params) {
const [isOverridingNonce, setNonceOverride] = useState(false);
const [currentNonce, setCurrentNonce] = useState<number | null>(null);

const safeTxs = useSafeTransactions(safe);
const safeTxs = useSafeTransactions(safe, Number.POSITIVE_INFINITY);

useEffect(() => {
handleChange(currentNonce);
Expand Down
Loading

0 comments on commit ba223fa

Please sign in to comment.