Skip to content

Commit

Permalink
test: add test for replication factor
Browse files Browse the repository at this point in the history
  • Loading branch information
mariocao committed Aug 8, 2024
1 parent 83fd7de commit 5916863
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion script/SedaProver.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract CreateDr is Script {
dr_inputs: "dr_inputs",
tally_binary_id: hashString("tally_binary_id"),
tally_inputs: "tally_inputs",
replication_factor: 123,
replication_factor: 1,
consensus_filter: "00",
gas_price: 456,
gas_limit: 789,
Expand Down
11 changes: 10 additions & 1 deletion test/SedaProver.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract SedaProverTest is Test {
dr_inputs: "dr_inputs",
tally_binary_id: hashString("tally_binary_id"),
tally_inputs: "tally_inputs",
replication_factor: 123,
replication_factor: 1,
consensus_filter: "0x00",
gas_price: 456,
gas_limit: 789,
Expand Down Expand Up @@ -372,4 +372,13 @@ contract SedaProverTest is Test {
abi.encodePacked(FilterType.StandardDeviation, uint64(stdJsonPath.length), stdJsonPath, sigma, numberType);
emit log_bytes(filter_std_dev);
}

function testReplicationFactorGreaterThanUnit() public {
assertEq(oracle.getDataRequestsFromPool(0, 10).length, 0);
SedaDataTypes.DataRequestInputs memory inputs = _getDataRequestInputs("0");
inputs.replication_factor = 2;

vm.expectRevert();
oracle.postDataRequest(inputs);
}
}

0 comments on commit 5916863

Please sign in to comment.