-
Notifications
You must be signed in to change notification settings - Fork 683
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
feat: global contract usage #12886
base: master
Are you sure you want to change the base?
feat: global contract usage #12886
Conversation
…ear/nearcore into stefan/global_contract_account_support
…bal_contract_usage
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12886 +/- ##
==========================================
- Coverage 70.53% 70.48% -0.05%
==========================================
Files 851 854 +3
Lines 174921 175594 +673
Branches 174921 175594 +673
==========================================
+ Hits 123374 123765 +391
- Misses 46420 46686 +266
- Partials 5127 5143 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This reverts commit 067c5bb.
ac40cd9
to
b4c4c2f
Compare
integration-tests/src/test_loop/tests/contract_distribution_cross_shard.rs
Outdated
Show resolved
Hide resolved
runtime/runtime/src/actions.rs
Outdated
// TODO(#12716): implement global contract usage | ||
let key = TrieKey::GlobalContractCode { identifier: action.contract_identifier.clone().into() }; | ||
if !state_update.contains_key(&key)? { | ||
return Err(RuntimeError::GlobalContractError(GlobalContractError::IdentifierNotFound( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost missed that: returning Err
here indicates internal error, so this will fail the whole chunk application. instead you should set error result for this action, like we do that for action_deploy_global_contract
:
result.result = Err(ActionErrorKind::GlobalContractIdentifierNotFound {...}).into());
return Ok(());
note that we need to add ActionErrorKind
instead of new RuntimeError
The PR adds testing and support for the
UseGlobalContract
action. Part of #12716