Hi,
I am trying to compile the following Solidity program but getting incompatibility issues with bytes32.
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
I am getting following error messages:
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.