sCrypt-Inc / scryptlib

Javascript SDK
MIT License
48 stars 29 forks source link

Missing contract description properties #53

Closed MerlinB closed 3 years ago

MerlinB commented 3 years ago

This broke during one of the recent commits: When compiling a contract to contract_desc.json and then loading the file and passing the object to buildContractClass, desc2CompileResult throws an error because it expects a sources property.

zhfnjust commented 3 years ago

sources property will auto gen when re compile the contract

MerlinB commented 3 years ago

Got it. The issue was that I didn't have the lastest VSCode extension.

zhfnjust commented 3 years ago

you can upgrade to 0.4.13 , which have nice new feature.

MerlinB commented 3 years ago

Getting yet another error when loading from file: Error: abi constructor params mismatch with args provided. This doesn't happen when the output from compileContract is used. I have rechecked that I have the most recent version everywhere.

MerlinB commented 3 years ago

I think the issue is that the compiler extracts the asm out of the sourceMap property (which is empty in the generated file) and ignores the asm property in the generated file: https://github.com/sCrypt-Inc/scryptlib/blob/af2801be18a187525248d7a3173cdca49363f02e/src/compilerWrapper.ts#L518

This leads to asm being empty in the loaded contract.

zhfnjust commented 3 years ago

OK, i will fix it soon.

zhfnjust commented 3 years ago

I think the issue is that the compiler extracts the asm out of the sourceMap property (which is empty in the generated file) and ignores the asm property in the generated file:

https://github.com/sCrypt-Inc/scryptlib/blob/af2801be18a187525248d7a3173cdca49363f02e/src/compilerWrapper.ts#L518

This leads to asm being empty in the loaded contract.

the bug has been fix at pr https://github.com/sCrypt-Inc/scryptlib/pull/54 you update your boilerplate or bump scryptlib to versoin 0.2.25

MerlinB commented 3 years ago

Thank you! Works fine.