hirosystems / stacks-subnets

Stacks Subnets: a layer-2 scaling solution for Stacks, intended for high-throughput, low-latency workloads
http://docs.hiro.so
GNU General Public License v3.0
51 stars 13 forks source link

refactor: Use templating to generate Clarity contracts for different deployment targets #304

Closed jbencin closed 1 year ago

jbencin commented 1 year ago

Description

This PR introduces templating to reduce repetition of certain variables. I chose Mustache because the CLI tool was easy to install and use, but we should eventually integrate something like this into Clarinet and we may want to consider alternative formats like Handlebars or Jinja (which are pretty much the same for this purpose)

This PR contains the following changes:

Applicable issues

Additional info (benefits, drawbacks, caveats)

This does not abstract away all references to the subnet contract version (meaning it doesn't fully address #297), but I'm not sure it's worth the effort to abstract the following additional references:

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #304 (57b8f8f) into develop (18b46bf) will decrease coverage by 26.28%. The diff coverage is n/a.

@@             Coverage Diff              @@
##           develop     #304       +/-   ##
============================================
- Coverage    86.27%   60.00%   -26.28%     
============================================
  Files            6        4        -2     
  Lines          357       45      -312     
  Branches        72        6       -66     
============================================
- Hits           308       27      -281     
+ Misses          49       18       -31     
Impacted Files Coverage Δ
...ontracts/contracts/templates/helper/simple-ft.clar 58.82% <ø> (ø)
...contracts/templates/helper/simple-nft-no-mint.clar 58.33% <ø> (ø)
...ntracts/contracts/templates/helper/simple-nft.clar 60.00% <ø> (ø)
...racts/contracts/templates/helper/test-helpers.clar 100.00% <ø> (ø)

... and 2 files with indirect coverage changes

blockstack-devops commented 1 year ago

:tada: This PR is included in version 0.8.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: