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 trait lookup #1817

Merged
merged 1 commit into from Aug 24, 2020
Merged

Fix trait lookup #1817

merged 1 commit into from Aug 24, 2020

Conversation

lgalabru
Copy link
Member

Address #1815

When optimising for O(1) retrieval in 084ec6e, I should have cascade the fact that the lookup_callable_contract method should be used, instead of accessing the hashmap directly.

@psq
Copy link
Contributor

psq commented Aug 19, 2020

will try the code with @friedger examples some time today, but I'm fairly optimistic this will work

@psq
Copy link
Contributor

psq commented Aug 19, 2020

I applied the patch and verified it was running fine with the original contracts from @friedger

"(define-trait trait-1 (
(get-1 (uint) (response uint uint))))
(define-public (wrapped-get-1 (contract <trait-1>))
(let ((val u0))
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps you could add a test with multiple let levels, just to be sure it works in that case as well (it should!)

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.

Good catch @lgalabru !

@jcnelson jcnelson self-requested a review August 22, 2020 01:08
Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

This LGTM!

@lgalabru lgalabru merged commit bdd0422 into master Aug 24, 2020
Krypton: Stacks 2.0 Testnet Phase 3 automation moved this from New Issues to Done Aug 24, 2020
@lgalabru lgalabru deleted the fix/lookup-traits branch August 24, 2020 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants