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 broken tests #316

Merged
merged 1 commit into from
Oct 12, 2024
Merged
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
fix broken tests
robertlincecum committed Oct 12, 2024

Verified

This commit was signed with the committer’s verified signature.
commit 231f12a201bc600692ee8844233ab862d93d3e06
18 changes: 6 additions & 12 deletions dist/quais.js
Original file line number Diff line number Diff line change
@@ -18984,10 +18984,10 @@ function accessListify(value) {
return value.map((set, index) => {
if (Array.isArray(set)) {
assertArgument(set.length === 2, 'invalid slot set', `value[${index}]`, set);
return accessSetify(set[0], set[1]);
return accessSetify(formatMixedCaseChecksumAddress(set[0]), set[1]);
}
assertArgument(set != null && typeof set === 'object', 'invalid address-slot set', 'value', value);
return accessSetify(set.address, set.storageKeys);
return accessSetify(formatMixedCaseChecksumAddress(set.address), set.storageKeys);
});
}
assertArgument(value != null && typeof value === 'object', 'invalid access list', 'value', value);
@@ -24181,10 +24181,7 @@ class AbstractSigner {
pop.accessList = tx.accessList;
}
else {
pop.accessList = (await this.createAccessList(tx))?.map((it) => {
it.address = formatMixedCaseChecksumAddress(it.address);
return it;
});
pop.accessList = await this.createAccessList(tx);
}
}
//@TOOD: Don't await all over the place; save them up for
@@ -30510,12 +30507,12 @@ class AbstractProvider {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_wrapTransactionResponse(tx, network) {
try {
if (tx.type === 0 || tx.type === 1) {
if (tx.type === '0x0' || tx.type === '0x1' || tx.type === 0 || tx.type === 1) {
// For QuaiTransaction, format and wrap as before
const formattedTx = formatTransactionResponse(tx);
return new QuaiTransactionResponse(formattedTx, this);
}
else if (tx.type === 2) {
else if (tx.type === '0x2' || tx.type === 2) {
// For QiTransaction, use fromProto() directly
return new QiTransactionResponse(tx, this);
}
@@ -33071,10 +33068,7 @@ class ContractFactory {
tx.from = this.runner.address;
}
const grindedTx = await this.grindContractAddress(tx);
grindedTx.accessList = (await this.runner.createAccessList?.(grindedTx))?.map((it) => {
it.address = formatMixedCaseChecksumAddress(it.address);
return it;
});
grindedTx.accessList = await this.runner.createAccessList?.(grindedTx);
const sentTx = await this.runner.sendTransaction(grindedTx);
const address = getStatic(this.constructor, 'getContractAddress')?.(tx);
return new BaseContract(address, this.interface, this.runner, sentTx);
2 changes: 1 addition & 1 deletion dist/quais.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/quais.min.js

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions dist/quais.umd.js
Original file line number Diff line number Diff line change
@@ -19006,10 +19006,10 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
return value.map((set, index) => {
if (Array.isArray(set)) {
assertArgument(set.length === 2, 'invalid slot set', `value[${index}]`, set);
return accessSetify(set[0], set[1]);
return accessSetify(formatMixedCaseChecksumAddress(set[0]), set[1]);
}
assertArgument(set != null && typeof set === 'object', 'invalid address-slot set', 'value', value);
return accessSetify(set.address, set.storageKeys);
return accessSetify(formatMixedCaseChecksumAddress(set.address), set.storageKeys);
});
}
assertArgument(value != null && typeof value === 'object', 'invalid access list', 'value', value);
@@ -24203,10 +24203,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
pop.accessList = tx.accessList;
}
else {
pop.accessList = (await this.createAccessList(tx))?.map((it) => {
it.address = formatMixedCaseChecksumAddress(it.address);
return it;
});
pop.accessList = await this.createAccessList(tx);
}
}
//@TOOD: Don't await all over the place; save them up for
@@ -30532,12 +30529,12 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_wrapTransactionResponse(tx, network) {
try {
if (tx.type === 0 || tx.type === 1) {
if (tx.type === '0x0' || tx.type === '0x1' || tx.type === 0 || tx.type === 1) {
// For QuaiTransaction, format and wrap as before
const formattedTx = formatTransactionResponse(tx);
return new QuaiTransactionResponse(formattedTx, this);
}
else if (tx.type === 2) {
else if (tx.type === '0x2' || tx.type === 2) {
// For QiTransaction, use fromProto() directly
return new QiTransactionResponse(tx, this);
}
@@ -33093,10 +33090,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
tx.from = this.runner.address;
}
const grindedTx = await this.grindContractAddress(tx);
grindedTx.accessList = (await this.runner.createAccessList?.(grindedTx))?.map((it) => {
it.address = formatMixedCaseChecksumAddress(it.address);
return it;
});
grindedTx.accessList = await this.runner.createAccessList?.(grindedTx);
const sentTx = await this.runner.sendTransaction(grindedTx);
const address = getStatic(this.constructor, 'getContractAddress')?.(tx);
return new BaseContract(address, this.interface, this.runner, sentTx);
2 changes: 1 addition & 1 deletion dist/quais.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/quais.umd.min.js

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions src/contract/factory.ts
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import { concat, defineProperties, getBytes, hexlify, assert, assertArgument } f
import { BaseContract, copyOverrides, resolveArgs } from './contract.js';

import type { InterfaceAbi } from '../abi/index.js';
import { formatMixedCaseChecksumAddress, validateAddress } from '../address/index.js';
import { validateAddress } from '../address/index.js';
import type { Addressable } from '../address/index.js';
import type { BytesLike } from '../utils/index.js';
import { getZoneForAddress } from '../utils/index.js';
@@ -139,10 +139,7 @@ export class ContractFactory<A extends Array<any> = Array<any>, I = BaseContract
}
const grindedTx = await this.grindContractAddress(tx);

grindedTx.accessList = (await this.runner.createAccessList?.(grindedTx))?.map((it) => {
it.address = formatMixedCaseChecksumAddress(it.address);
return it;
});
grindedTx.accessList = await this.runner.createAccessList?.(grindedTx);

const sentTx = await this.runner.sendTransaction(grindedTx);
const address = getStatic<(tx: ContractDeployTransaction) => string>(
4 changes: 2 additions & 2 deletions src/providers/abstract-provider.ts
Original file line number Diff line number Diff line change
@@ -1051,11 +1051,11 @@ export class AbstractProvider<C = FetchRequest> implements Provider {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_wrapTransactionResponse(tx: any, network: Network): TransactionResponse {
try {
if (tx.type === 0 || tx.type === 1) {
if (tx.type === '0x0' || tx.type === '0x1' || tx.type === 0 || tx.type === 1) {
// For QuaiTransaction, format and wrap as before
const formattedTx = formatTransactionResponse(tx) as QuaiTransactionResponseParams;
return new QuaiTransactionResponse(formattedTx, this);
} else if (tx.type === 2) {
} else if (tx.type === '0x2' || tx.type === 2) {
// For QiTransaction, use fromProto() directly
return new QiTransactionResponse(tx, this);
} else {
7 changes: 2 additions & 5 deletions src/signers/abstract-signer.ts
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* Generally the [Wallet](../classes/Wallet) and [JsonRpcSigner](../classes/JsonRpcSigner) and their sub-classes are
* sufficent for most developers, but this is provided to fascilitate more complex Signers.
*/
import { AddressLike, formatMixedCaseChecksumAddress, resolveAddress, validateAddress } from '../address/index.js';
import { AddressLike, resolveAddress, validateAddress } from '../address/index.js';
import { defineProperties, getBigInt, resolveProperties, assert, assertArgument } from '../utils/index.js';
import { addressFromTransactionRequest, copyRequest, QuaiTransactionRequest } from '../providers/provider.js';

@@ -148,10 +148,7 @@ export abstract class AbstractSigner<P extends null | Provider = null | Provider
if (tx.accessList) {
pop.accessList = tx.accessList;
} else {
pop.accessList = (await this.createAccessList(tx))?.map((it) => {
it.address = formatMixedCaseChecksumAddress(it.address);
return it;
});
pop.accessList = await this.createAccessList(tx);
}
}
//@TOOD: Don't await all over the place; save them up for
6 changes: 3 additions & 3 deletions src/transaction/accesslist.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { validateAddress } from '../address/index.js';
import { getAddress } from '../address/index.js';
import { getAddress, formatMixedCaseChecksumAddress } from '../address/index.js';
import { assertArgument, isHexString } from '../utils/index.js';

import type { AccessList, AccessListish } from './index.js';
@@ -36,10 +36,10 @@ export function accessListify(value: AccessListish): AccessList {
(set, index) => {
if (Array.isArray(set)) {
assertArgument(set.length === 2, 'invalid slot set', `value[${index}]`, set);
return accessSetify(set[0], set[1]);
return accessSetify(formatMixedCaseChecksumAddress(set[0]), set[1]);
}
assertArgument(set != null && typeof set === 'object', 'invalid address-slot set', 'value', value);
return accessSetify(set.address, set.storageKeys);
return accessSetify(formatMixedCaseChecksumAddress(set.address), set.storageKeys);
},
);
}