Skip to content
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

Fix callable type issue (DO NOT MERGE) #4623

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from
Draft

Conversation

obycode
Copy link
Contributor

@obycode obycode commented Apr 2, 2024

Description

This fixes the issue described in #4622. This is still a work in progress, as I am not sure yet if this is the appropriate fix or if there is a call to concretize on the type missing somewhere.

It also needs to be gated on an epoch or on a new version of Clarity.

Applicable issues

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • Changelog is updated
  • Required documentation changes (e.g., docs/rpc/openapi.yaml and rpc-endpoints.md for v2 endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo
  • New integration test(s) added to bitcoin-tests.yml

This is still a work in progress, as I am not sure yet if this is the
appropriate fix or if there is a call to `concretize` on the type
missing somewhere.

See: #4622
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 83.32%. Comparing base (c383bdd) to head (c9de60b).

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #4623      +/-   ##
==========================================
+ Coverage   83.14%   83.32%   +0.17%     
==========================================
  Files         470      470              
  Lines      332698   332758      +60     
  Branches      317      317              
==========================================
+ Hits       276635   277256     +621     
+ Misses      56055    55494     -561     
  Partials        8        8              
Files Coverage Δ
...ity/src/vm/analysis/type_checker/v2_1/tests/mod.rs 99.85% <100.00%> (+<0.01%) ⬆️
clarity/src/vm/analysis/type_checker/v2_1/mod.rs 90.49% <50.00%> (-0.27%) ⬇️

... and 45 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c383bdd...c9de60b. Read the comment docs.

Copy link
Member

@kantai kantai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep -- this change looks good to me (once its version gated or epoch gated). Version gating is probably easier if Clarity3 is going to exist anyways for the new block height behaviors.

@Acaccia
Copy link
Contributor

Acaccia commented Jun 11, 2024

@obycode the fix doesn't seem to work for response types.

#[test]
fn test_replace_at_response_err_callable() {
    let contract = r#"(replace-at? 
        (list 
            (err 'SX3M0F9YG3TS7YZDDV7B22H2C5J0BHG0WD0T3QSSN.DAHdSGMHgxMWaithtPBEqfuTWZGMqy) 
            (ok 5)
        ) 
        u0 
        (err 'SX3M0F9YG3TS7YZDDV7B22H2C5J0BHG0WD0T3QSSN.DAHdSGMHgxMWaithtPBEqfuTWZGMqy)
    )"#;

    assert!(mem_type_check(contract).is_ok());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants