merklejerk / solpp

A solidity preprocessor and flattener CLI and library
Apache License 2.0
112 stars 14 forks source link

Use semver.compare instead of semver.cmp #16

Open blockwell-admin opened 3 years ago

blockwell-admin commented 3 years ago

The cmp function in semver expects an operand: function cmp (a, op, b, loose), but it was being called with just two versions: sv.cmp(a, b).

The compare function matches the expected signature and behavior: function compare (a, b, loose).

In practice, this meant that the sorting at the end of semver-merge didn't work correctly. I ran into this when contracts had the same base version, but different range specifiers, eg.: =0.4.24 and >=0.4.24.