Skip to content

Commit 9139bf7

Browse files
committed
Fix commit_hash type in Neuron::commit_weights precompile
1 parent 68b3d77 commit 9139bf7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

runtime/src/precompiles/neuron.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl NeuronPrecompile {
3939
handle.try_dispatch_runtime_call(call, RawOrigin::Signed(handle.caller_account_id()))
4040
}
4141

42-
#[precompile::public("commitWeights(uint16,uint256)")]
42+
#[precompile::public("commitWeights(uint16,bytes32)")]
4343
#[precompile::payable]
4444
pub fn commit_weights(
4545
handle: &mut impl PrecompileHandle,

runtime/src/precompiles/solidity/neuron.abi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
"type": "uint16"
2626
},
2727
{
28-
"internalType": "uint256",
28+
"internalType": "bytes32",
2929
"name": "commitHash",
30-
"type": "uint256"
30+
"type": "bytes32"
3131
}
3232
],
3333
"name": "commitWeights",
@@ -230,4 +230,4 @@
230230
"stateMutability": "payable",
231231
"type": "function"
232232
}
233-
]
233+
]

runtime/src/precompiles/solidity/neuron.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ interface INeuron {
9999
* @dev Commits the weights for a neuron.
100100
*
101101
* @param netuid The subnet to commit the weights for (uint16).
102-
* @param commitHash The commit hash for the weights (uint256).
102+
* @param commitHash The commit hash for the weights (bytes32).
103103
*/
104-
function commitWeights(uint16 netuid, uint256 commitHash) external payable;
104+
function commitWeights(uint16 netuid, bytes32 commitHash) external payable;
105105

106106
/**
107107
* @dev Reveals the weights for a neuron.

0 commit comments

Comments
 (0)