Contracts Bump ApiVersion and add test (#3619)

ApiVersion should have been bumped with
https://github.com/paritytech/polkadot-sdk/pull/3606
this does that and add a test so we don't forget to do that everytime
This commit is contained in:
PG Herveou
2024-03-08 10:48:55 +01:00
committed by GitHub
parent 2aa006e094
commit f977c21157
4 changed files with 18 additions and 2 deletions
@@ -497,9 +497,14 @@ fn expand_docs(def: &EnvDef) -> TokenStream2 {
fn expand_env(def: &EnvDef, docs: bool) -> TokenStream2 {
let impls = expand_impls(def);
let docs = docs.then_some(expand_docs(def)).unwrap_or(TokenStream2::new());
let stable_api_count = def.host_funcs.iter().filter(|f| f.is_stable).count();
quote! {
pub struct Env;
#[cfg(test)]
pub const STABLE_API_COUNT: usize = #stable_api_count;
#impls
/// Documentation of the API (host functions) available to contracts.
///