@@ -2,13 +2,16 @@ import { type Plugin, defineConfig } from "@wagmi/cli";
22import { readFileSync , readdirSync } from "node:fs" ;
33import path from "node:path" ;
44
5- interface CannonOptions {
5+ interface DeploymentsOptions {
66 directory : string ;
77 includes ?: RegExp [ ] ;
88 excludes ?: RegExp [ ] ;
99}
1010
11- const shouldIncludeFile = ( name : string , config : CannonOptions ) : boolean => {
11+ const shouldIncludeFile = (
12+ name : string ,
13+ config : DeploymentsOptions ,
14+ ) : boolean => {
1215 if ( config . excludes ) {
1316 // if there is a list of excludes, then if the name matches any of them, then exclude
1417 for ( const exclude of config . excludes ) {
@@ -30,11 +33,11 @@ const shouldIncludeFile = (name: string, config: CannonOptions): boolean => {
3033 return true ;
3134} ;
3235
33- const cannonDeployments = ( config : CannonOptions ) : Plugin => {
36+ const deployments = ( config : DeploymentsOptions ) : Plugin => {
3437 return {
35- name : "cannon " ,
38+ name : "cartesi " ,
3639 contracts : ( ) => {
37- // list all files exported by cannon in directory
40+ // list all files exported by devnet in directory
3841 const files = readdirSync ( config . directory ) . filter ( ( file ) =>
3942 shouldIncludeFile ( file , config ) ,
4043 ) ;
@@ -60,7 +63,7 @@ const cannonDeployments = (config: CannonOptions): Plugin => {
6063export default defineConfig ( {
6164 out : "src/contracts.ts" ,
6265 plugins : [
63- cannonDeployments ( {
66+ deployments ( {
6467 directory : "node_modules/@cartesi/devnet/deployments" ,
6568 } ) ,
6669 ] ,
0 commit comments