Skip to content

Commit

Permalink
fix wrong origin
Browse files Browse the repository at this point in the history
  • Loading branch information
open-junius committed Jan 31, 2025
1 parent e2c5115 commit 648cd81
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion runtime/src/precompiles/neuron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ impl NeuronPrecompile {
netuid,
hotkey,
});
try_dispatch_runtime_call(handle, call, contract_to_origin(&CONTRACT_ADDRESS_SS58)?)

let account_id =
<HashedAddressMapping<BlakeTwo256> as AddressMapping<AccountId32>>::into_account_id(
handle.context().caller,
);

try_dispatch_runtime_call(handle, call, RawOrigin::Signed(account_id))
}

fn parse_netuid_hotkey_parameter(data: &[u8]) -> Result<(u16, AccountId32), PrecompileFailure> {
Expand Down

0 comments on commit 648cd81

Please sign in to comment.