odra
odra copied to clipboard
Make livenet work with contracts without events
Currently, loading a contract which doesn't use CES events panics, because livenet env loads events count internally. This makes impossible testing contracts which don't use CES.
You should remove querying for event count in the register contract method on HostEnv. It should be loaded lazily.
Steps to reproduce:
- Download some casper cep implementation eg https://github.com/casper-ecosystem/cep-78-enhanced-nft
- Setup a local network
- Deploy a contract manually, without CES support, eg
casper-client put-deploy --node-address http://localhost:11101/rpc/ \
--chain-name "casper-net-1" \
--payment-amount 500000000000 \
--secret-key ./secret_key.pem \
--session-path ./contract.wasm \
--session-arg "collection_name:string='CEP-78-collection'" \
--session-arg "collection_symbol:string='CEP78'" \
--session-arg "total_token_supply:u64='100'" \
--session-arg "ownership_mode:u8='2'" \
--session-arg "nft_kind:u8='1'" \
--session-arg "nft_metadata_kind:u8='0'" \
--session-arg "json_schema:string='nft-schema'" \
--session-arg "identifier_mode:u8='0'" \
--session-arg "metadata_mutability:u8='0'"
- Interact with the contract using livenet client.