uuosio / ascdk

MIT License
12 stars 9 forks source link

Build error with export #46

Closed jafri closed 2 years ago

jafri commented 2 years ago

@learnforpractice could you kindly have a look at this:

https://github.com/uuosio/ascdk/blob/6621212b34d7b2c76208d6e1b77dda0902e1c97c/examples/atomicassets/atomicassets.contract.ts#L8

Building fails if export is added

Works fine without export

learnforpractice commented 2 years ago

What's the error?

jafri commented 2 years ago

You can try with ascdk-dev branch, I added code to examples

lots of errors

All the variant is/get throw error it seems with export

learnforpractice commented 2 years ago

I haven't seen any errors. Here is the test result:

test.py::test_hello PASSED
test.py::test_action PASSED
test.py::test_counter PASSED
test.py::test_token PASSED
test.py::test_codegeneration PASSED
test.py::test_notify PASSED
test.py::test_singleton PASSED
test.py::test_allow PASSED
test.py::test_escrow PASSED
test.py::test_balance PASSED
learnforpractice commented 2 years ago

Ok, let me update the source code and have another try.

learnforpractice commented 2 years ago

Why do you want to export KvContract? This is the main class and does not expect to be exported.

jafri commented 2 years ago

Good for contract composability, like contract Abc importing KvContract to instantiate it, and then call it's methods

Also another dev messaged me saying they were running into an issue and I narrowed it down to the export, so its unexpected behavior for export to throw issue in valid code

learnforpractice commented 2 years ago

Yeah, sounds like the asc compiler does not happy with the exported class. Give me some the to find out the reason.

jafri commented 2 years ago

It kind of looks like our transformer misses the exported class

learnforpractice commented 2 years ago

Fixed by 2fba770d70ff7e2c3ae84ba52aa2438c86b74085