clarinet icon indicating copy to clipboard operation
clarinet copied to clipboard

DevNet deployment: impl-trait of [[project.requirements]] contract not adjusted correctly by clarinet

Open dabuchera opened this issue 3 years ago • 2 comments

Hi all,

The following improvement could be helpful for development. Right now clarinet is not adjusting the deployer address for impl-trait of a contract which is itself part of [[project.requirements]]

For example if there is the following token contract with impl-trait in the first line

(impl-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.sip-010-trait)

clarinet is extracting and remapping the deployer address for the devnet-plan.yaml correctly.

- requirement-publish:
            contract-id: SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard
            remap-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
            remap-principals:
              SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
            cost: 8400
            path: ".requirements\\SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard.clar"
        - requirement-publish:
            contract-id: SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.test
            remap-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
            remap-principals:
              SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM
            cost: 18240
            path: ".requirements\\SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.test.clar"

Clarinet is also extracting dependencies of the SP2KAF9RF86PVX3NEE27DFV1CQX0T4WGR41X3S45C.test.clar contract automatically and remap them as well. This is correct and good.

But the problem is, that within the contract which is located in .requirements, this deployer address is not adjusted.

In other words, clarinet is remapping SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-010-trait-ft-standard to ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.sip-010-trait-ft-standard but within test.clar this reference is not updated and has to be manually.

dabuchera avatar Jul 29 '22 12:07 dabuchera

Hi @dabuchera, thank you for opening this issue! Do you have a repo published somewhere (GitHub?) outlining the issue that you're experiencing so that I can reproduce it on my local setup? Thank you!

lgalabru avatar Aug 01 '22 18:08 lgalabru

Hi Ludo Sure. Here you go https://github.com/dabuchera/test-deployment-stuff

dabuchera avatar Aug 02 '22 07:08 dabuchera

I just tested the repo above, and was unable to spot an issue with the latest version of clarinet. Feel free to re-open this issue if you're still experiencing it.

lgalabru avatar Nov 11 '22 03:11 lgalabru