Skip to content

Commit

Permalink
refactor(gadgets.ts): simplify witness creation and rotation operations
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinMinkov committed Oct 22, 2023
1 parent 5b0de01 commit de2c091
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/examples/gadgets.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { Field, Provable, Experimental, Gadgets } from 'o1js';

let cs = Provable.constraintSystem(() => {
let res1 = Provable.witness(Field, () => {
let f = Field(12);
return Gadgets.rot(f, 2, 'left');
});
let res2 = Provable.witness(Field, () => {
let f = Field(12);
return Gadgets.rot(f, 2, 'right');
});
let f = Provable.witness(Field, () => Field(12));

let res1 = Gadgets.rot(f, 2, 'left');
let res2 = Gadgets.rot(f, 2, 'right');

res1.assertEquals(Field(48));
res2.assertEquals(Field(3));
Expand Down

0 comments on commit de2c091

Please sign in to comment.