Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed txHash -> txHashes #10

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/OmenAgentResultMapping.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ contract OmenAgentResultMapping {
address indexed marketAddress,
uint16 estimatedProbabilityBps,
address indexed publisherAddress,
bytes32 txHash,
bytes32[] txHashes,
bytes32 ipfsHash
);

Expand All @@ -24,7 +24,7 @@ contract OmenAgentResultMapping {
require(address(msg.sender) == address(prediction.publisherAddress), "Only publisher can add a prediction");
marketPredictions[marketAddress].push(prediction);
emit PredictionAdded(
marketAddress, prediction.estimatedProbabilityBps, msg.sender, prediction.txHash, prediction.ipfsHash
marketAddress, prediction.estimatedProbabilityBps, msg.sender, prediction.txHashes, prediction.ipfsHash
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/structs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ pragma solidity ^0.8.24;
struct Prediction {
address publisherAddress;
bytes32 ipfsHash;
bytes32 txHash;
bytes32[] txHashes;
uint16 estimatedProbabilityBps; // in basis points, 0-10000
}
7 changes: 5 additions & 2 deletions test/OmenAgentResultMapping.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ contract OmenAgentResultMappingTest is Test {
bytes32 ipfsHash = keccak256(abi.encodePacked(input));
bytes32 dummyTxHash = keccak256(abi.encodePacked("dummy transaction hash"));
uint16 estimatedProbabilityBps = 6556; //65.56%
Prediction memory prediction = Prediction(publisher, ipfsHash, dummyTxHash, estimatedProbabilityBps);
bytes32[] memory txHashes = new bytes32[](2);
txHashes[0] = dummyTxHash;
txHashes[1] = dummyTxHash;
Prediction memory prediction = Prediction(publisher, ipfsHash, txHashes, estimatedProbabilityBps);
return prediction;
}

Expand Down Expand Up @@ -61,7 +64,7 @@ contract OmenAgentResultMappingTest is Test {
marketAddress,
prediction.estimatedProbabilityBps,
prediction.publisherAddress,
prediction.txHash,
prediction.txHashes,
prediction.ipfsHash
);
omenAgentResultMapping.addPrediction(marketAddress, prediction);
Expand Down