Skip to content

Commit

Permalink
runtime-sdk/modules/evm: Bump version to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Sep 13, 2023
1 parent fb7a0d1 commit 3186a88
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runtime-sdk/modules/evm/src/lib.rs
Expand Up @@ -664,6 +664,7 @@ impl<Cfg: Config> Module<Cfg> {
#[sdk_derive(Module)]
impl<Cfg: Config> Module<Cfg> {
const NAME: &'static str = MODULE_NAME;
const VERSION: u32 = 2;
type Error = Error;
type Event = Event;
type Parameters = Parameters;
Expand All @@ -675,6 +676,11 @@ impl<Cfg: Config> Module<Cfg> {
Self::set_params(genesis.parameters);
}

#[migration(from = 1)]
fn migrate_v1_to_v2() {
// No state migration is needed for v2.
}

#[handler(call = "evm.Create")]
fn tx_create<C: TxContext>(ctx: &mut C, body: types::Create) -> Result<Vec<u8>, Error> {
Self::create(ctx, body.value, body.init_code)
Expand Down

0 comments on commit 3186a88

Please sign in to comment.