Skip to content

Commit 1894cd8

Browse files
committed
fix #261
1 parent 3e331c8 commit 1894cd8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/frontend/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ pub mod tests {
10961096

10971097
#[should_panic]
10981098
#[test]
1099-
fn test_incorrect_pod() {
1099+
fn test_reject_duplicate_new_entry() {
11001100
// try to insert the same key multiple times
11011101
// right now this is not caught when you build the pod,
11021102
// but it is caught on verify
@@ -1119,15 +1119,26 @@ pub mod tests {
11191119
let mut prover = MockProver {};
11201120
let pod = builder.prove(&mut prover, &params).unwrap();
11211121
pod.pod.verify().unwrap();
1122+
}
11221123

1124+
#[should_panic]
1125+
#[test]
1126+
fn test_reject_unsound_statement() {
11231127
// try to insert a statement that doesn't follow from the operation
11241128
// right now the mock prover catches this when it calls compile()
1129+
let params = Params::default();
1130+
let vd_set = &*DEFAULT_VD_SET;
11251131
let mut builder = MainPodBuilder::new(&params, &vd_set);
11261132
let self_a = AnchoredKey::from((SELF, "a"));
11271133
let self_b = AnchoredKey::from((SELF, "b"));
11281134
let value_of_a = Statement::equal(self_a.clone(), Value::from(3));
11291135
let value_of_b = Statement::equal(self_b.clone(), Value::from(27));
11301136

1137+
let op_new_entry = Operation(
1138+
OperationType::Native(NativeOperation::NewEntry),
1139+
vec![],
1140+
OperationAux::None,
1141+
);
11311142
builder.insert(false, (value_of_a.clone(), op_new_entry.clone()));
11321143
builder.insert(false, (value_of_b.clone(), op_new_entry));
11331144
let st = Statement::equal(self_a, self_b);

0 commit comments

Comments
 (0)