I am logging a specific event from a specific contract using nethereum. However, my event emits contract state (enum in solidity). My log processor shows 0 events instead of 2.
Solidity code snippet:
// event
event Transaction(address from, StateType contractState);
// function
function submitProof
(string memory clm_num, string memory lin_typ, string memory lin_st, string memory out_rsrv, string memory tot_paid, string memory date_post) public
{
ProofData memory inputTransaction;
inputTransaction.claim_num = clm_num;
inputTransaction.line_typ = lin_typ;
inputTransaction.line_status = lin_st;
inputTransaction.outstanding_rsrv = out_rsrv;
inputTransaction.total_paid = tot_paid;
inputTransaction.date_posted = date_post;
inputTransaction.isDataPresent = true;
if (contractState == StateType.ZeroState || contractState == StateType.RetrievedState) {
cedeData = inputTransaction;
contractState = StateType.CedeState;
}
else {
if (cedeData.isDataPresent && contractState == StateType.CedeState) {
verifiedData = inputTransaction;
if (sha256(abi.encode(cedeData)) == sha256(abi.encode(verifiedData)))
contractState = StateType.AuditState;
}
}
emit Transaction(msg.sender, contractState);
}
Nethereum code snippet:
// event class
[Event("Transaction")]
public class Transaction : IEventDTO
{
[Parameter("address", "from", 1, false)]
public string Sender { get; set; }
[Parameter("int", "contractState", 2, false)]
public string ContractState { get; set; }
}
// logic to log event
The logs show count 0 where I expect count to be 2. Also how to extract data from log to show that on UI? I couldn't find any extraction logic in Nethereum docs.