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

Fix typos #1397

Merged
merged 6 commits into from
Feb 2, 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
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 @@ -576,7 +576,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
Loading