I am getting some errors related to bytes32. I tried to use the casting but it is not solving the proble. My code is:
pragma solidity ^0.5.6.0;
contract peInKSub{
bytes32 [] m_pendingIndex ;
struct pendingConfirmation{
bytes32 index;
uint yetNeeded;
bytes32 pendingOp;
}
pendingConfirmation pending;
function confirmAndCheck ( bytes32 _operation )public returns ( bool ) {
pending.pendingOp = m_pendingIndex [ _operation ];
// if we 're not yet working on this operation ,
// switch over and reset the confirmation status .
if ( pending . yetNeeded == 0) {
pending . index = m_pendingIndex[_operation] . length ++;
//m_pendingIndex [ pending . index ] = _operation ;
}//if
}//fun
}//contract
My error messages are:
solc prg46.sol prg46.sol:14:38: Error: Type bytes32 is not implicitly convertible to expected type uint256. pending.pendingOp = m_pendingIndex [ _operation ]; ^--------^ prg46.sol:18:35: Error: Type bytes32 is not implicitly convertible to expected type uint256. pending . index = m_pendingIndex[_operation] . length ++; ^--------^ prg46.sol:18:20: Error: Expression has to be an lvalue. pending . index = m_pendingIndex[_operation] . length ++; ^---------------------------------^ prg46.sol:18:20: Error: Type uint8 is not implicitly convertible to expected type bytes32. pending . index = m_pendingIndex[_operation] . length ++; ^------------------------------------^
Somebody please guide me.
Zulfi.