- Notifications
You must be signed in to change notification settings - Fork 477
Closed
Description
Description: Even though I used #[ink(message, selector = 0xc0defafe)] to set the selector, it didn’t take effect—I still have to use the original selector to successfully call the function.
#![cfg_attr(not(feature = "std"), no_std, no_main)] #[ink::contract] mod flipper { #[ink(storage)] pub struct Flipper { /// Stores a single `bool` value on the storage. value: bool, } impl Flipper { #[ink(constructor)] pub fn new(init_value: bool) -> Self { Self { value: init_value } } #[ink(message, selector = 0xc0defafe)] pub fn gettest(&self) -> i32 { 100 } } }cargo contract build --generate code-only --metadata solidity Execute with c0defafe
revive/target/release/revive-runner -f inkTester/target/ink/flipper.polkavm -c c0defafe thread 'main' panicked at crates/runner/src/lib.rs:163:9: assertion `left == right` failed: contract execution result mismatch: Exec { result: ContractResult { gas_consumed: Weight { ref_time: 43382986, proof_size: 11909 }, gas_required: Weight { ref_time: 43382986, proof_size: 11909 }, storage_deposit: StorageDeposit::Charge(0), result: Ok(ExecReturnValue { flags: REVERT, data: [1, 1] }) }, wall_time: 689.4µs } left: true right: false note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Execute with a941ae43 (default of gettest())
revive/target/release/revive-runner -f inkTester/target/ink/flipper.polkavm -c a941ae43 Call #0 raw return bytes: 0x Call #1 raw return bytes: 0x0000000000000000000000000000000000000000000000000000000000000064 Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels