allow smart contract to register automation task#356
allow smart contract to register automation task#356sjoshisupra wants to merge 4 commits intodevfrom
Conversation
aregng
left a comment
There was a problem hiding this comment.
General Question:
When unchecked registrations later fail during scheduling or execution what would be the expected troubleshooting approach?
| _ty_args: Vec<Type>, | ||
| _args: VecDeque<Value>, | ||
| ) -> SafeNativeResult<SmallVec<[Value; 1]>> { | ||
| // Guard against binary/framework version mismatch: if the node binary does not yet include |
There was a problem hiding this comment.
If binary does not include the native function then any attempt of the call from contract's context will fail and will not reach this point at all. The comment above is missleading.
This if condition simply double checks that this function can be called only if automation v2.1 feature is enabled.
| automation_fee_cap_for_epoch: u64, | ||
| aux_data: vector<vector<u8>> | ||
| ) acquires AutomationRegistryV2, AutomationCycleDetails, ActiveAutomationRegistryConfigV2, AutomationRefundBookkeeping { | ||
| assert!(features::supra_automation_v2_1_enabled(), EDISABLED_AUTOMATION_FEATURE); |
There was a problem hiding this comment.
EDISABLED_AUTOMATION_FEATURE error is reported if in general automation feature is not enabled.
Either the error message should be updated to make it more generic, or dedicated error code should be introduced for this case.
In UX point of view dedicated error code is preferable.
Fixes issue https://github.com/Entropy-Foundation/smr-moonshot/issues/2739
-- Add a public interface to allow smart contracts to call
-- Add native method to obtain
txn_app_hashto be stored asparent_hash