When writing a policy with this SDK, the policy has to implement some boilerplate:
#[no_mangle]
pub extern "C" fn wapc_init() {
register_function("validate", validate);
register_function("validate_settings", validate_settings::<Settings>);
register_function("protocol_version", protocol_version_guest);
}
Add a macro that generates this code automatically, something like:
guest_entrypoints!(
validate => validate,
validate_settings => Settings,
)
The protocol_version will be automatically set by the macro to a generated function that returns the default ProtocolVersion with the current protocol version of the SDK being used by the policy.
Naming can likely be improved :)
When writing a policy with this SDK, the policy has to implement some boilerplate:
Add a macro that generates this code automatically, something like:
The
protocol_versionwill be automatically set by the macro to a generated function that returns the default ProtocolVersion with the current protocol version of the SDK being used by the policy.Naming can likely be improved :)