Skip to content

upgrade_pool event does not include old WASM hash #241

Description

@ritaifeoluwa

Description

The Factory contract's upgrade_pool function does not emit an event with the old WASM hash. The event only includes the new hash, making it impossible to know what the pool was upgraded from.

Current behavior

env.events().publish(
    (symbol_short!("factory"), symbol_short!("pool_upg")),
    (pool_id, record.address, new_wasm_hash),
);

Expected behavior

Include the old hash:

let old_hash = env.deployer().get_wasm_hash(&record.address);
env.events().publish(
    (symbol_short!("factory"), symbol_short!("pool_upg")),
    (pool_id, record.address, old_hash, new_wasm_hash),
);

Why this matters

Off-chain indexers need both hashes for rollback scenarios and audit trails.

Labels

enhancement, factory, good first issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions