New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TESTNET BUG] contract-of
can't be used with traits from function parameters in clarity within a let
context
#1815
Comments
I can't rename the issue, but the description is not accurate (it was hard to tell). The problem comes from the additional scope added by If you modify your contract to:
all 4 tests will pass. Maybe @lgalabru might have some ideas why For @lgalabru benefit, the original function was:
|
possibly something not fully addressed by #1643? |
Thanks for the submission @friedger 👍 |
Working on a fix - #1817 |
contract-of
can't be used with traits from function parameters in claritycontract-of
can't be used with traits from function parameters in clarity within a let
context
@friedger this should be merged to |
@jcnelson I ran the tests with the lastest clarity-cli from master successfully. Thank you. |
Describe the bug
Given there is a function with a trait as a parameter and the function body contains a call to
contract-of
with this trait then this function can't be used.When calling the function the parameter is a contract principal, but
contract-of
requires a trait type and the call fails withUnchecked(ContractOfExpectsTrait)
Steps To Reproduce
clarity contract
In unit test using a client:
Expected behavior
The contract call should return the contract principal
Environment
stacks-node version
stacks-node 0.1.0 => 23.0.0.0 (master:2fb1dcf+, release build, linux [x86_64])
Additional context
Discovered during development of https://github.com/friedger/clarity-marketplace
If you think this is eligible for a bug bounty, please check the relevant boxes below:
Critical, Launch Blocking Bugs
Consensus critical bugs
State corruption
Stolen funds
contract-call?
Take control and/or bring network to a halt
Major, Launch Blocking Bugs
Major bugs
Minor, Non-launch blocking bugs
Minor bugs
@timstackblock
The text was updated successfully, but these errors were encountered: