vfat-io / adventure-party

Helper contract for andrecronje/rarity
40 stars 63 forks source link

New Schedule Scripts Failing #6

Closed tiequan12345 closed 2 years ago

tiequan12345 commented 2 years ago

Hey there,

I've used the old deploy scripts with no issues in the past, was trying out the automation scripts and am getting some errors:


adventure-party@1.0.0 display-status npx hardhat run scripts/status.ts

Creating Typechain artifacts in directory typechain for target ethers-v5 Successfully generated Typechain artifacts!

/Users/Downloads/adventure-party/node_modules/ts-node/src/index.ts:692 return new TSError(diagnosticText, diagnosticCodes); ^ TSError: ⨯ Unable to compile TypeScript: typechain/factories/AdventurePartyfactory.ts:16:3 - error TS2416: Property 'deploy' in type 'AdventurePartyfactory' is not assignable to the same property in base type 'ContractFactory'. Type '(overrides?: Overrides | undefined) => Promise' is not assignable to type '(...args: any[]) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'AdventureParty' is not assignable to type 'Contract'. The types returned by 'queryFilter(...)' are incompatible between these types. Type 'Promise<TypedEvent[]>' is not assignable to type 'Promise<Event[]>'. Type 'TypedEvent[]' is not assignable to type 'Event[]'. Type 'TypedEvent' is not assignable to type 'Event'. Types of property 'args' are incompatible. Type 'unknown' is not assignable to type 'Result | undefined'. Type 'unknown' is not assignable to type 'Result'.

16 deploy(overrides?: Overrides): Promise {

typechain/factories/AdventureParty__factory.ts:22:3 - error TS2416: Property 'attach' in type 'AdventureParty__factory' is not assignable to the same property in base type 'ContractFactory'.
  Type '(address: string) => AdventureParty' is not assignable to type '(address: string) => Contract'.
    Type 'AdventureParty' is not assignable to type 'Contract'.

22   attach(address: string): AdventureParty {

typechain/factories/AdventurePartyfactory.ts:25:3 - error TS2416: Property 'connect' in type 'AdventurePartyfactory' is not assignable to the same property in base type 'ContractFactory'. Type '(signer: Signer) => AdventurePartyfactory' is not assignable to type '(signer: Signer) => ContractFactory'. Call signature return types 'AdventurePartyfactory' and 'ContractFactory' are incompatible. The types of 'deploy' are incompatible between these types. Type '(overrides?: Overrides | undefined) => Promise' is not assignable to type '(...args: any[]) => Promise'.

25 connect(signer: Signer): AdventureParty__factory {



    at createTSError (/Users/Downloads/adventure-party/node_modules/ts-node/src/index.ts:692:12)
    at reportTSError (/Users/Downloads/adventure-party/node_modules/ts-node/src/index.ts:696:19)
    at getOutput (/Users/Downloads/adventure-party/node_modules/ts-node/src/index.ts:883:36)
    at Object.compile (/Users/Downloads/adventure-party/node_modules/ts-node/src/index.ts:1185:30)
    at Module.m._compile (/Users/Downloads/adventure-party/node_modules/ts-node/src/index.ts:1309:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/Downloads/adventure-party/node_modules/ts-node/src/index.ts:1313:12)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)

---

any idea how to resolve?  Double checked and followed the instructions in the readme.
vfat0 commented 2 years ago

try deleting the artifacts folder and compiling again

tiequan12345 commented 2 years ago

I deleted the artifacts folder and tried running it and had the same error.

Actually I forgot to mention before that the new 2 lines here didn't work for me:

npm run compile npm run test

I get:

adventure-party@1.0.0 compile npx hardhat run compile

Error HH601: Script compile doesn't exist.

And:

adventure-party@1.0.0 test npx hardhat run test

Creating Typechain artifacts in directory typechain for target ethers-v5 Successfully generated Typechain artifacts! Error: Cannot find module '/Users/Downloads/adventure-party/test'

I didn't see a compile script anywhere in the repo either.

vfat0 commented 2 years ago

ah yes probably should've test those, sorry about that! should be fixed now

tiequan12345 commented 2 years ago

Cool so compile and test both work now, but I get the same error when running display status even after deleting the artifacts directory:

adventure-party % npm run display-status

adventure-party@1.0.0 display-status npx hardhat run scripts/status.ts

Compiling 5 files with 0.8.7 Compilation finished successfully Creating Typechain artifacts in directory typechain for target ethers-v5 Successfully generated Typechain artifacts!

/Users/Downloads/adventure-party/node_modules/ts-node/src/index.ts:692 return new TSError(diagnosticText, diagnosticCodes); ^ TSError: ⨯ Unable to compile TypeScript: typechain/factories/AdventurePartyfactory.ts:16:3 - error TS2416: Property 'deploy' in type 'AdventurePartyfactory' is not assignable to the same property in base type 'ContractFactory'. Type '(overrides?: Overrides | undefined) => Promise' is not assignable to type '(...args: any[]) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'AdventureParty' is not assignable to type 'Contract'. The types returned by 'queryFilter(...)' are incompatible between these types. Type 'Promise<TypedEvent[]>' is not assignable to type 'Promise<Event[]>'. Type 'TypedEvent[]' is not assignable to type 'Event[]'. Type 'TypedEvent' is not assignable to type 'Event'. Types of property 'args' are incompatible. Type 'unknown' is not assignable to type 'Result | undefined'. Type 'unknown' is not assignable to type 'Result'.

SHA-2048 commented 2 years ago

sorry for that ! Will investigate the problem

tiequan12345 commented 2 years ago

awesome! Thanks, I tested your revised code and it compiles and works now!