CosmWasm / sylvia

CosmWasm smart contract framework
Apache License 2.0
93 stars 14 forks source link

feat: Support generics on `messages` attribute in main `contract` call #238

Closed jawoznia closed 11 months ago

jawoznia commented 11 months ago

close #226

codecov[bot] commented 11 months ago

Codecov Report

Merging #238 (fd40f3d) into feat/generics_support (f046d9e) will decrease coverage by 0.08%. The diff coverage is 89.28%.

@@                    Coverage Diff                    @@
##           feat/generics_support     #238      +/-   ##
=========================================================
- Coverage                  88.36%   88.29%   -0.08%     
=========================================================
  Files                         25       25              
  Lines                       1444     1478      +34     
=========================================================
+ Hits                        1276     1305      +29     
- Misses                       168      173       +5     
Files Coverage Δ
sylvia-derive/src/interfaces.rs 90.65% <100.00%> (+2.14%) :arrow_up:
sylvia-derive/src/message.rs 87.35% <100.00%> (ø)
sylvia/tests/generics.rs 0.00% <0.00%> (ø)
sylvia-derive/src/parser.rs 83.09% <64.28%> (-1.33%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

jawoznia commented 11 months ago

Seems mostly good, but I missed some tests. What happens if I try to implement the same interface twice with different generics? I think it should fail due to name collision. Also - can the contract itself be generic at this point? I believe not, right?

One thing I really miss is the tests of multitest utilities generated.

I tested it with some more interfaces in this PR https://github.com/CosmWasm/sylvia/pull/239. Is it cool to deliver it separately?

Yes you cannot implement same interface twice due to name collisions.