Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWilsn committed Oct 24, 2023
1 parent b55b972 commit 2bf90af
Show file tree
Hide file tree
Showing 28 changed files with 806 additions and 762 deletions.
14 changes: 7 additions & 7 deletions client/Build.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ async function buildSolidity() {
},
},
},
})
)
}),
),
);

for (const file of Object.keys(output.contracts)) {
const outfile = fileURLToPath(
new URL(`./src/contracts/${file}.ts`, import.meta.url)
new URL(`./src/contracts/${file}.ts`, import.meta.url),
);

let content = ["/* THIS FILE IS AUTOGENERATED */"];
Expand All @@ -78,13 +78,13 @@ async function buildSolidity() {
const prefix = contract.toUpperCase();
content.push(
`export const ${prefix}_ABI = ${JSON.stringify(
output.contracts[file][contract].abi
)} as const;`
output.contracts[file][contract].abi,
)} as const;`,
);
content.push(
`export const ${prefix}_BYTECODE = ${JSON.stringify(
"0x" + bytecode
)};`
"0x" + bytecode,
)};`,
);
}

Expand Down
40 changes: 20 additions & 20 deletions client/src/glue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type TemplateContext = { [key: string]: string | HTMLElement };

abstract class Template extends HTMLElement {
public static define(
templateName: string
templateName: string,
): (new (_: TemplateContext) => Template) & typeof Template {
const clazz = class extends Template {
constructor(values: TemplateContext) {
Expand Down Expand Up @@ -98,7 +98,7 @@ const SignTransactionTemplate = Template.define("wtf-sign-transaction");
const SendTransactionTemplate = Template.define("wtf-send-transaction");
const AddEthereumChainTemplate = Template.define("wtf-add-ethereum-chain");
const SwitchEthereumChainTemplate = Template.define(
"wtf-switch-ethereum-chain"
"wtf-switch-ethereum-chain",
);

export class ManualGlue extends Glue {
Expand Down Expand Up @@ -159,7 +159,7 @@ export class ManualGlue extends Glue {
"switchethereumchain",
new SwitchEthereumChainEvent(domain, {
chainId,
})
}),
);
}

Expand All @@ -168,7 +168,7 @@ export class ManualGlue extends Glue {
const chainId = data.get("chain-id");
let chainName = data.get("chain-name");
const blockExplorerUrls = ManualGlue.splitArray(
data.get("block-explorer-urls")
data.get("block-explorer-urls"),
);
const iconUrls = ManualGlue.splitArray(data.get("icon-urls"));
const rpcUrls = ManualGlue.splitArray(data.get("rpc-urls"));
Expand All @@ -191,7 +191,7 @@ export class ManualGlue extends Glue {
blockExplorerUrls,
iconUrls,
rpcUrls,
})
}),
);
}

Expand All @@ -209,7 +209,7 @@ export class ManualGlue extends Glue {
const accounts = accountsText.split(/[^a-fA-Fx0-9]/);
this.emit(
"requestaccounts",
new RequestAccountsEvent(domain, { accounts })
new RequestAccountsEvent(domain, { accounts }),
);
}

Expand Down Expand Up @@ -255,7 +255,7 @@ export class ManualGlue extends Glue {

this.emit(
"sendtransaction",
new SendTransactionEvent(domain, { from, to, value, data: data_ })
new SendTransactionEvent(domain, { from, to, value, data: data_ }),
);
}

Expand Down Expand Up @@ -287,7 +287,7 @@ export class ManualGlue extends Glue {

this.emit(
"signtransaction",
new SignTransactionEvent(domain, { from, to, value, data: data_ })
new SignTransactionEvent(domain, { from, to, value, data: data_ }),
);
}

Expand Down Expand Up @@ -370,7 +370,7 @@ export class ManualGlue extends Glue {
}

override async switchEthereumChain(
action: SwitchEthereumChain
action: SwitchEthereumChain,
): Promise<void> {
if (action.action !== "approve") {
throw "not implemented";
Expand All @@ -379,7 +379,7 @@ export class ManualGlue extends Glue {
await this.instruct(
new SwitchEthereumChainTemplate({
id: action.id,
})
}),
);
}

Expand All @@ -391,7 +391,7 @@ export class ManualGlue extends Glue {
await this.instruct(
new AddEthereumChainTemplate({
id: action.id,
})
}),
);
}

Expand All @@ -411,7 +411,7 @@ export class ManualGlue extends Glue {
new RequestAccountsTemplate({
id: action.id,
accounts: list,
})
}),
);
}

Expand All @@ -423,7 +423,7 @@ export class ManualGlue extends Glue {
await this.instruct(
new SignMessageTemplate({
id: action.id,
})
}),
);
}

Expand All @@ -435,7 +435,7 @@ export class ManualGlue extends Glue {
await this.instruct(
new SendTransactionTemplate({
id: action.id,
})
}),
);
}

Expand All @@ -447,7 +447,7 @@ export class ManualGlue extends Glue {
await this.instruct(
new SignTransactionTemplate({
id: action.id,
})
}),
);
}

Expand All @@ -462,7 +462,7 @@ export class ManualGlue extends Glue {
Number.parseInt(ev.chainId),
Number.parseInt(action.chainId),
`expected to switch to chain ${action.chainId},` +
` but got ${ev.chainId}`
` but got ${ev.chainId}`,
);

switchActionPromise = this.switchEthereumChain({
Expand Down Expand Up @@ -512,21 +512,21 @@ export class ManualGlue extends Glue {
assert.strictEqual(
addEvent.rpcUrls.length,
1,
`expected one RPC URL, but got ${addEvent.rpcUrls.length}`
`expected one RPC URL, but got ${addEvent.rpcUrls.length}`,
);

assert.strictEqual(
addEvent.rpcUrls[0],
action.rpcUrl,
`expected an RPC URL of "${action.rpcUrl}",` +
` but got "${addEvent.rpcUrls[0]}"`
` but got "${addEvent.rpcUrls[0]}"`,
);

assert.strictEqual(
Number.parseInt(addEvent.chainId),
Number.parseInt(action.chainId),
`expected a chain id of ${action.chainId},` +
` but got ${addEvent.chainId}`
` but got ${addEvent.chainId}`,
);

await this.addEthereumChain({
Expand Down Expand Up @@ -586,7 +586,7 @@ export class ManualGlue extends Glue {
new ActivateChainTemplate({
"chain-id": action.chainId,
"rpc-url": action.rpcUrl,
})
}),
);
}

Expand Down
2 changes: 1 addition & 1 deletion client/src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
Expand Down
8 changes: 4 additions & 4 deletions client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function main() {
if ("params" in msg.body) {
if (!(msg.body.params instanceof Array)) {
throw new TypeError(
"'params' in body not an array"
"'params' in body not an array",
);
}

Expand All @@ -255,9 +255,9 @@ function main() {
JSON.stringify({
number: msg.number,
result: { jsonrpc: "2.0", ...result },
})
}),
);
})
}),
);

const open = spawn(async () => {
Expand Down Expand Up @@ -307,7 +307,7 @@ function main() {
});

webSocket.addEventListener("open", open);
})
}),
);
}

Expand Down
6 changes: 3 additions & 3 deletions client/src/tests/eth/blockNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("blockNumber", () => {
assert.equal(
walletInitalBlockNumber,
ganacheInitalBlockNumber,
"initalBlockNumber"
"initalBlockNumber",
);

await blockchain.test.mine({ blocks: 5000 });
Expand All @@ -31,7 +31,7 @@ describe("blockNumber", () => {
ganacheFinalBlockNumber,
expected,
`blockchain's final block number (${ganacheFinalBlockNumber}) equals` +
` wallet's initial block number plus number mined (${expected})`
` wallet's initial block number plus number mined (${expected})`,
);

await retry(async () => {
Expand All @@ -41,7 +41,7 @@ describe("blockNumber", () => {
walletFinalBlockNumber,
ganacheFinalBlockNumber,
`wallet's final block number (${walletFinalBlockNumber}) equals` +
` blockchain's final block number (${ganacheFinalBlockNumber})`
` blockchain's final block number (${ganacheFinalBlockNumber})`,
);
});
});
Expand Down
5 changes: 2 additions & 3 deletions client/src/tests/eth/createAccessList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ describe("createAccessList", () => {
],
};

const fromBlockchain: unknown = await blockchain.provider.request(
request
);
const fromBlockchain: unknown =
await blockchain.provider.request(request);
const fromWallet: unknown = await wallet.provider.request(request);

assert.deepEqual(fromBlockchain, fromWallet);
Expand Down
8 changes: 4 additions & 4 deletions client/src/tests/eth/getBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe("getBalance", () => {
assert.equal(
walletInitalBalance.toString(),
ganacheInitalBalance.toString(),
"initalBalance"
"initalBalance",
);

const value = 1n;
Expand All @@ -83,7 +83,7 @@ describe("getBalance", () => {
assert.equal(
walletFinalBalance.toString(),
ganacheFinalBalance.toString(),
"finalBalance"
"finalBalance",
);

const expected = value + walletInitalBalance;
Expand All @@ -107,7 +107,7 @@ describe("getBalance", () => {
assert.equal(
walletInitalBalance.toString(),
ganacheInitalBalance.toString(),
"initalBalance"
"initalBalance",
);

const value = 1n;
Expand All @@ -127,7 +127,7 @@ describe("getBalance", () => {
assert.equal(
walletFinalBalance.toString(),
ganacheFinalBalance.toString(),
"finalBalance"
"finalBalance",
);

const expected = value + walletInitalBalance;
Expand Down
2 changes: 1 addition & 1 deletion client/src/tests/eth/getBlockByNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("getBlockByNumber", () => {
await assert.rejects(
wallet.public.getBlock({
blockNumber,
})
}),
);
});
});
6 changes: 3 additions & 3 deletions client/src/tests/eth/getBlockTransactionCountByHash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe("getBlockTransactionCountByHash", () => {
blockHash0,
`first transaction block ${mined0?.blockNumber ?? "<none>"} (${
mined0?.blockHash ?? "<none>"
}) matches mined block ${blockNumber + 1n} (${blockHash0})`
}) matches mined block ${blockNumber + 1n} (${blockHash0})`,
);

// Create a block with two transactions
Expand Down Expand Up @@ -88,7 +88,7 @@ describe("getBlockTransactionCountByHash", () => {
blockHash1,
`third transaction block ${mined1?.blockNumber ?? "<none>"} (${
mined1?.blockHash ?? "<none>"
})` + ` matches mined block ${blockNumber + 2n} (${blockHash1})`
})` + ` matches mined block ${blockNumber + 2n} (${blockHash1})`,
);

const count0 = await wallet.public.getBlockTransactionCount({
Expand All @@ -109,7 +109,7 @@ describe("getBlockTransactionCountByHash", () => {
wallet.public.getBlockTransactionCount({
blockHash:
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
})
}),
);
});
});
4 changes: 2 additions & 2 deletions client/src/tests/eth/getBlockTransactionCountByNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe("getBlockTransactionCountByNumber", () => {
blockNumber + 2n,
`transaction block (${
mined?.blockNumber ?? "<none>"
}) matches mined block (${blockNumber + 2n})`
}) matches mined block (${blockNumber + 2n})`,
);

const count0 = await wallet.public.getBlockTransactionCount({
Expand All @@ -76,7 +76,7 @@ describe("getBlockTransactionCountByNumber", () => {
wallet.public.getBlockTransactionCount({
blockNumber:
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn,
})
}),
);
});
});
4 changes: 2 additions & 2 deletions client/src/tests/eth/getFilterChanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe("getFilterChanges", () => {
wallet.provider.request({
method: "eth_getFilterChanges",
params: ["0xdeadc0de"],
})
}),
);
});

Expand Down Expand Up @@ -99,7 +99,7 @@ describe("getFilterChanges", () => {
assert.equal(logs[0].blockNumber, blockNumber + 1n);
assert.equal(
logs[0].topics[1],
"0x00000000000000000000000000000000000000000000000000000000000004d2"
"0x00000000000000000000000000000000000000000000000000000000000004d2",
);
assert.equal(logs[0].transactionHash, call);
assert.equal(logs[0].transactionIndex, receipt.transactionIndex);
Expand Down
Loading

0 comments on commit 2bf90af

Please sign in to comment.