DA0-DA0 / polytone

An account on every blockchain for every smart contract.
42 stars 5 forks source link

fix cw v1.2 #42

Closed Art3miX closed 1 year ago

Art3miX commented 1 year ago

We only need cw v1.2 in the voice, so no reason to block note for it

also did clippy and fmt

The just optimize was using rust-optimizer and not workspace-optimizer, which for some reason messed up dependency versions, so fixed that.

Art3miX commented 1 year ago

could we make this format job part of CI? :)

I don't know how :( , its not part of the cargo fmt but I used the vscode formatter manually

0xekez commented 1 year ago

@Art3miX - this is looking great. looks like there is something up with the simulation tests, then should be good to merge.

0xekez commented 1 year ago

@Art3miX I pondered this PR for a while. I think this is a great solution, given the constraint that we can't fix workspace-optimizer, but there are no rules! and I don't think that constraint is real. Your bash skills here are sublime, what would you think about doing a PR into workspace-optimizer to optimize all the contracts in the workspace?, or at least investigating why this constraint exists.

Art3miX commented 1 year ago

ok finally done with it.

We need to be extra careful here, we have 2 folders (main and accessories) that hold contracts, as long as voice is the last contract alphabetically, and no other contract is using the cw v1.2 feature we are good, but here are some cases that can happen which will mess things up:

  1. X contract in accessories that adds cw v1.2 feature -> will resolve in main contracts including the feature and wont work on none cw 1.2 chains.
  2. X contract in main folder that alphabetically is after voice -> will resolve in X including cw 1.2 feature without explicitly including it
  3. Any folder after main alphabetically -> will resolve in any contract in those folders including cw 1.2 feature without explicitly including it