Closed aaroncox closed 11 months ago
I didn't want to merge this and lose the conversation, but I did publish this branch as 0.3.2/0.3.3/0.3.4. I figure since we're not publicly pushing for people to use the kit, and this was codegen only changes, I could get away with it 😉
Reason was that I needed to update the dependencies and get a release out, but didn't want to conflict with dev.
Gotta say... this codegen stuff is pretty damn neat.
So what this pull request does is a few things:
ABI
andBlob
out of theContract
and places them in the root namespace and exposes them.Contract
now uses theabi
value from the root namespace during construction.Contract
is moved into the namespace._
in front of the namespace is removed (we can discuss this, but I thought it wasn't needed?)test/data/contracts/mock-rewards.ts
) that we can manually craft to get the desired syntax we want.PartialBy
as described in https://github.com/wharfkit/contract/issues/44types
toTypes
in the namespace, since everything else is camel casedContract
tests into a function calledrunGenericContractTests
so we can run identical tests against static contracts, generated contracts, and mock contracts https://github.com/wharfkit/contract/pull/43/commits/66bf96042009d126cd8ba0462e19af32060c4621Most of the changes I made were to make it so we could run tests against both a generated and mock contract at the same time. This was so we could work on adding/changing things in the mock contract, ensuring the tests pass, and then modify the code generator to output something that was identical to the mock contract.