Skip to content

Fix some spelling errors #4928

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions src.ts/_admin/update-changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ type PresentVersion = {
}

// If this is a new version (not present in npm) add the changes
// from the lastest version until HEAD.
// from the latest version until HEAD.
const curVer = loadJson(resolve("package.json")).version;
if (curVer !== lastVer) {
// Include any present entry, as it was placed here by a
Expand All @@ -140,7 +140,7 @@ type PresentVersion = {
entries.push(pres);
}

// Also include theentry from git
// Also include the entry from git
const latest = await getChanges(lastVer.gitHead, "HEAD");
if (latest.length) {
entries.push({
Expand All @@ -151,7 +151,7 @@ type PresentVersion = {
}
}

// Gerenate the CHANGELOG.md output
// Generate the CHANGELOG.md output
const output: Array<string> = [ ];
output.push("Change Log");
output.push("==========");
Expand Down
2 changes: 1 addition & 1 deletion src.ts/_tests/test-providers-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe("Tests Provider Call Exception", function() {
assert.equal(error.action, method, `error.action == ${ method }`);
assert.equal(error.reason, `Panic due to ${ reason }(${ code })`, "error.reason");

// Check the transaciton
// Check the transaction
assert.equal(error.transaction.to, tx.to, `error.transaction.to`);
assert.equal(error.transaction.data, tx.data, `error.transaction.data`);

Expand Down
4 changes: 2 additions & 2 deletions src.ts/_tests/test-utils-maths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ describe("Tests Twos Compliemnts Functions", function() {
];

for (const { twos, width, value } of tests) {
it(`computes twos compliment values: ${ value }[${ width } bits]`, function() {
it(`computes twos complement values: ${ value }[${ width } bits]`, function() {
const result = toTwos(value, width);
assert.equal(result, twos);
});
}

for (const { twos, width, value } of tests) {
it(`computes values from twos compliment: ${ value }[${ width } bits]`, function() {
it(`computes values from twos complement: ${ value }[${ width } bits]`, function() {
const result = fromTwos(twos, width);
assert.equal(result, value);
});
Expand Down
2 changes: 1 addition & 1 deletion src.ts/abi/coders/abstract-coder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ export class Reader {
// Allows incomplete unpadded data to be read; otherwise an error
// is raised if attempting to overrun the buffer. This is required
// to deal with an old Solidity bug, in which event data for
// external (not public thoguh) was tightly packed.
// external (not public though) was tightly packed.
readonly allowLoose!: boolean;

readonly #data: Uint8Array;
Expand Down
14 changes: 7 additions & 7 deletions src.ts/abi/fragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const regexWhitespacePrefix = new RegExp("^(\\s*)");
const regexNumberPrefix = new RegExp("^([0-9]+)");
const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");

// Parser regexs to check validity
// Parser regexes to check validity
const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");
const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");

Expand Down Expand Up @@ -669,7 +669,7 @@ export class ParamType {
/**
* Returns true if %%this%% is an Array type.
*
* This provides a type gaurd ensuring that [[arrayChildren]]
* This provides a type guard ensuring that [[arrayChildren]]
* and [[arrayLength]] are non-null.
*/
isArray(): this is (ParamType & { arrayChildren: ParamType, arrayLength: number }) {
Expand All @@ -679,7 +679,7 @@ export class ParamType {
/**
* Returns true if %%this%% is a Tuple type.
*
* This provides a type gaurd ensuring that [[components]]
* This provides a type guard ensuring that [[components]]
* is non-null.
*/
isTuple(): this is (ParamType & { components: ReadonlyArray<ParamType> }) {
Expand All @@ -689,7 +689,7 @@ export class ParamType {
/**
* Returns true if %%this%% is an Indexable type.
*
* This provides a type gaurd ensuring that [[indexed]]
* This provides a type guard ensuring that [[indexed]]
* is non-null.
*/
isIndexable(): this is (ParamType & { indexed: boolean }) {
Expand Down Expand Up @@ -936,8 +936,8 @@ export abstract class Fragment {
abstract format(format?: FormatType): string;

/**
* Creates a new **Fragment** for %%obj%%, wich can be any supported
* ABI frgament type.
* Creates a new **Fragment** for %%obj%%, which can be any supported
* ABI fragment type.
*/
static from(obj: any): Fragment {
if (typeof(obj) === "string") {
Expand Down Expand Up @@ -984,7 +984,7 @@ export abstract class Fragment {
});
}

assertArgument(false, "unsupported frgament object", "obj", obj);
assertArgument(false, "unsupported fragment object", "obj", obj);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src.ts/abi/typed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ export class Typed {
/**
* @_ignore:
*/
constructor(gaurd: any, type: string, value: any, options?: any) {
constructor(guard: any, type: string, value: any, options?: any) {
if (options == null) { options = null; }
assertPrivate(_gaurd, gaurd, "Typed");
assertPrivate(_gaurd, guard, "Typed");
defineProperties<Typed>(this, { _typedSymbol, type, value });
this.#options = options;

Expand Down
2 changes: 1 addition & 1 deletion src.ts/address/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function fromBase36(value: string): bigint {
* If you wish the checksum of %%address%% to be ignore, it should
* be converted to lower-case (i.e. ``.toLowercase()``) before
* being passed in. This should be a very rare situation though,
* that you wish to bypass the safegaurds in place to protect
* that you wish to bypass the safeguards in place to protect
* against an address that has been incorrectly copied from another
* source.
*
Expand Down
4 changes: 2 additions & 2 deletions src.ts/address/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ null;

/**
* An interface for objects which have an address, and can
* resolve it asyncronously.
* resolve it asynchronously.
*
* This allows objects such as [[Signer]] or [[Contract]] to
* be used most places an address can be, for example getting
Expand All @@ -42,7 +42,7 @@ export interface NameResolver {
/**
* Resolve to the address for the ENS %%name%%.
*
* Resolves to ``null`` if the name is unconfigued. Use
* Resolves to ``null`` if the name is unconfigured. Use
* [[resolveAddress]] (passing this object as %%resolver%%) to
* throw for names that are unconfigured.
*/
Expand Down
10 changes: 5 additions & 5 deletions src.ts/contract/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ type Sub = {
};


// The combination of TypeScrype, Private Fields and Proxies makes
// The combination of TypeScript, Private Fields and Proxies makes
// the world go boom; so we hide variables with some trickery keeping
// a symbol attached to each BaseContract which its sub-class (even
// via a Proxy) can reach and use to look up its internal values.
Expand Down Expand Up @@ -643,7 +643,7 @@ export class BaseContract implements Addressable, EventEmitterable<ContractEvent
* The target to connect to.
*
* This can be an address, ENS name or any [[Addressable]], such as
* another contract. To get the resovled address, use the ``getAddress``
* another contract. To get the resolved address, use the ``getAddress``
* method.
*/
readonly target!: string | Addressable;
Expand Down Expand Up @@ -841,7 +841,7 @@ export class BaseContract implements Addressable, EventEmitterable<ContractEvent
* resolve immediately if already deployed.
*/
async waitForDeployment(): Promise<this> {
// We have the deployement transaction; just use that (throws if deployement fails)
// We have the deployment transaction; just use that (throws if deployment fails)
const deployTx = this.deploymentTransaction();
if (deployTx) {
await deployTx.wait();
Expand Down Expand Up @@ -884,7 +884,7 @@ export class BaseContract implements Addressable, EventEmitterable<ContractEvent
/**
* Return the function for a given name. This is useful when a contract
* method name conflicts with a JavaScript name such as ``prototype`` or
* when using a Contract programatically.
* when using a Contract programmatically.
*/
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T {
if (typeof(key) !== "string") { key = key.format(); }
Expand All @@ -895,7 +895,7 @@ export class BaseContract implements Addressable, EventEmitterable<ContractEvent
/**
* Return the event for a given name. This is useful when a contract
* event name conflicts with a JavaScript name such as ``prototype`` or
* when using a Contract programatically.
* when using a Contract programmatically.
*/
getEvent(key: string | EventFragment): ContractEvent {
if (typeof(key) !== "string") { key = key.format(); }
Expand Down
2 changes: 1 addition & 1 deletion src.ts/crypto/pbkdf2.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* A **Password-Based Key-Derivation Function** is designed to create
* a sequence of bytes suitible as a **key** from a human-rememberable
* a sequence of bytes suitable as a **key** from a human-rememberable
* password.
*
* @_subsection: api/crypto:Passwords [about-pbkdf]
Expand Down
4 changes: 2 additions & 2 deletions src.ts/crypto/scrypt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ let __scryptSync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p
* but demonstrates to value of imposing large costs to decryption.
*
* For this reason, if building a UI which involved decrypting or
* encrypting datsa using scrypt, it is recommended to use a
* [[ProgressCallback]] (as event short periods can seem lik an eternity
* encrypting data using scrypt, it is recommended to use a
* [[ProgressCallback]] (as event short periods can seem like an eternity
* if the UI freezes). Including the phrase //"decrypting"// in the UI
* can also help, assuring the user their waiting is for a good reason.
*
Expand Down
6 changes: 3 additions & 3 deletions src.ts/crypto/signing-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ export class SigningKey {
* private key and the %%other%% key.
*
* The %%other%% key may be any type of key, a raw public key,
* a compressed/uncompressed pubic key or aprivate key.
* a compressed/uncompressed public key or a private key.
*
* Best practice is usually to use a cryptographic hash on the
* returned value before using it as a symetric secret.
* returned value before using it as a symmetric secret.
*
* @example:
* sign1 = new SigningKey(id("some-secret-1"))
Expand Down Expand Up @@ -178,7 +178,7 @@ export class SigningKey {
}

/**
* Returns the point resulting from adding the ellipic curve points
* Returns the point resulting from adding the elliptic curve points
* %%p0%% and %%p1%%.
*
* This is not a common function most developers should require, but
Expand Down
8 changes: 4 additions & 4 deletions src.ts/hash/typed-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export class TypedDataEncoder {
* The primary type for the structured [[types]].
*
* This is derived automatically from the [[types]], since no
* recursion is possible, once the DAG for the types is consturcted
* recursion is possible, once the DAG for the types is constructed
* internally, the primary type must be the only remaining type with
* no parent nodes.
*/
Expand Down Expand Up @@ -324,7 +324,7 @@ export class TypedDataEncoder {
// Recursively check children
checkCircular(child, found);

// Mark all ancestors as having this decendant
// Mark all ancestors as having this descendant
for (const subtype of found) {
(subtypes.get(subtype) as Set<string>).add(child);
}
Expand All @@ -343,7 +343,7 @@ export class TypedDataEncoder {
}

/**
* Returnthe encoder for the specific %%type%%.
* Return the encoder for the specific %%type%%.
*/
getEncoder(type: string): (value: any) => string {
let encoder = this.#encoderCache.get(type);
Expand Down Expand Up @@ -464,7 +464,7 @@ export class TypedDataEncoder {
}

/**
* Call %%calback%% for each value in %%value%%, passing the type and
* Call %%callback%% for each value in %%value%%, passing the type and
* component within %%value%%.
*
* This is useful for replacing addresses or other transformation that
Expand Down
10 changes: 5 additions & 5 deletions src.ts/providers/abstract-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// @TODO
// Event coalescence
// When we register an event with an async value (e.g. address is a Signer
// or ENS name), we need to add it immeidately for the Event API, but also
// or ENS name), we need to add it immediately for the Event API, but also
// need time to resolve the address. Upon resolving the address, we need to
// migrate the listener to the static event. We also need to maintain a map
// of Signer/ENS name to address so we can sync respond to listenerCount.
Expand Down Expand Up @@ -190,7 +190,7 @@ export interface Subscriber {
*/
export class UnmanagedSubscriber implements Subscriber {
/**
* The name fof the event.
* The name for the event.
*/
name!: string;

Expand Down Expand Up @@ -1236,7 +1236,7 @@ export class AbstractProvider implements Provider {
return null;
}

// Something reerted
// Something reverted
if (isError(error, "CALL_EXCEPTION")) { return null; }

throw error;
Expand Down Expand Up @@ -1548,7 +1548,7 @@ export class AbstractProvider implements Provider {
// Stop all listeners
this.removeAllListeners();

// Shut down all tiemrs
// Shut down all timers
for (const timerId of this.#timers.keys()) {
this._clearTimeout(timerId);
}
Expand Down Expand Up @@ -1618,7 +1618,7 @@ export class AbstractProvider implements Provider {
let timeout = timer.time;
if (timeout < 0) { timeout = 0; }

// Start time (in cause paused, so we con compute remaininf time)
// Start time (in cause paused, so we con compute remaining time)
timer.time = getTime();

// Start the timer
Expand Down
10 changes: 5 additions & 5 deletions src.ts/providers/abstract-signer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Generally the [[Wallet]] and [[JsonRpcSigner]] and their sub-classes
* are sufficent for most developers, but this is provided to
* fascilitate more complex Signers.
* facilitate more complex Signers.
*
* @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]
*/
Expand Down Expand Up @@ -52,7 +52,7 @@ async function populate(signer: AbstractSigner, tx: TransactionRequest): Promise


/**
* An **AbstractSigner** includes most of teh functionality required
* An **AbstractSigner** includes most of the functionality required
* to get a [[Signer]] working as expected, but requires a few
* Signer-specific methods be overridden.
*
Expand Down Expand Up @@ -185,7 +185,7 @@ export abstract class AbstractSigner<P extends null | Provider = null | Provider
}

// Explicitly set untyped transaction to legacy
// @TODO: Maybe this shold allow type 1?
// @TODO: Maybe this should allow type 1?
pop.type = 0;

} else {
Expand All @@ -208,7 +208,7 @@ export abstract class AbstractSigner<P extends null | Provider = null | Provider
}
}

//@TOOD: Don't await all over the place; save them up for
//@TODO: Don't await all over the place; save them up for
// the end for better batching
return await resolveProperties(pop);
}
Expand Down Expand Up @@ -241,7 +241,7 @@ export abstract class AbstractSigner<P extends null | Provider = null | Provider
}

/**
* A **VoidSigner** is a class deisgned to allow an address to be used
* A **VoidSigner** is a class designed to allow an address to be used
* in any API which accepts a Signer, but for which there are no
* credentials available to perform any actual signing.
*
Expand Down
2 changes: 1 addition & 1 deletion src.ts/providers/default-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export function getDefaultProvider(network?: string | Networkish | WebSocketLike
let quorum = Math.floor(providers.length / 2);
if (quorum > 2) { quorum = 2; }

// Testnets don't need as strong a security gaurantee and speed is
// Testnets don't need as strong a security guarantee and speed is
// more useful during testing
if (staticNetwork && Testnets.indexOf(staticNetwork.name) !== -1) { quorum = 1; }

Expand Down
Loading