Skip to content

Commit

Permalink
Merge pull request #1397 from cristiantroy/main
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
Trivo25 authored Feb 2, 2024
2 parents fea4239 + 67074b6 commit 4368e89
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/examples/api_exploration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const b3: Bool = b0.and(b1.not()).or(b1);
): T
```
`Provable.if(b, x, y)` evaluates to `x` if `b` is true, and evalutes to `y` if `b` is false,
`Provable.if(b, x, y)` evaluates to `x` if `b` is true, and evaluates to `y` if `b` is false,
so it works like a ternary if expression `b ? x : y`.
The generic type T can be instantiated to primitive types like Bool, Field, or Group, or
Expand Down
2 changes: 1 addition & 1 deletion src/lib/circuit_value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ function cloneCircuitValue<T>(obj: T): T {
// primitive JS types and functions aren't cloned
if (typeof obj !== 'object' || obj === null) return obj;

// HACK: callbacks, account udpates
// HACK: callbacks, account updates
if (
obj.constructor?.name.includes('GenericArgument') ||
obj.constructor?.name.includes('Callback')
Expand Down
2 changes: 1 addition & 1 deletion src/lib/hash-input.unit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let NetworkPrecondition = provableFromLayout<NetworkPrecondition, any>(
);
let Body = provableFromLayout<Body, any>(bodyLayout as any);

// test with random account udpates
// test with random account updates
test(Random.json.accountUpdate, (accountUpdateJson) => {
fixVerificationKey(accountUpdateJson);
let accountUpdate = AccountUpdate.fromJSON(accountUpdateJson);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/precondition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ function assertPreconditionInvariants(accountUpdate: AccountUpdate) {
let self = context.isSelf ? 'this' : 'accountUpdate';
let dummyPreconditions = Preconditions.ignoreAll();
for (let preconditionPath of context.read) {
// check if every precondition that was read was also contrained
// check if every precondition that was read was also constrained
if (context.constrained.has(preconditionPath)) continue;

// check if the precondition was modified manually, which is also a valid way of avoiding an error
Expand Down
2 changes: 1 addition & 1 deletion src/lib/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ const reservedPropNames = new Set(['_methods', '_']);
function assertStatePrecondition(sc: SmartContract) {
try {
for (let [key, context] of getStateContexts(sc)) {
// check if every state that was read was also contrained
// check if every state that was read was also constrained
if (!context?.wasRead || context.wasConstrained) continue;
// we accessed a precondition field but not constrained it explicitly - throw an error
let errorMessage = `You used \`this.${key}.get()\` without adding a precondition that links it to the actual on-chain state.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class CircuitString extends CircuitValue {
.slice(0, length)
.concat(otherChars.slice(0, n - length));
}
// compute the actual result, by always picking the char which correponds to the actual length
// compute the actual result, by always picking the char which corresponds to the actual length
let result: Character[] = [];
let mask = this.lengthMask();
for (let i = 0; i < n; i++) {
Expand Down

0 comments on commit 4368e89

Please sign in to comment.