Skip to content

Commit

Permalink
prettier upgrade rules (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
MCarlomagno authored Jan 31, 2024
1 parent 22d5f81 commit 5b0b43f
Show file tree
Hide file tree
Showing 13 changed files with 205 additions and 156 deletions.
6 changes: 2 additions & 4 deletions examples/create-batch-proposal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ const contracts = [
address: ERC20Token,
name: 'ERC20 Token',
network: 'goerli',
abi:
'[{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]',
abi: '[{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]',
},
{
address: RolesContract,
network: 'goerli',
name: 'Roles Contract',
abi:
'[{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"}]',
abi: '[{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"}]',
},
];

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"jest": "^29.6.4",
"nx": "^16.5.0",
"nx-cloud": "^16.5.2",
"prettier": "^2.0.4",
"prettier": "^2.4.1",
"ts-jest": "^29.1.1",
"typescript": "^4.9.3"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/base/src/api/__mocks__/axios-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ export const mockAxiosError: AxiosError = {
config: {
url: '/relayer',
method: 'get',
headers: ({
headers: {
'Accept': 'application/json, text/plain, */*',
'X-Api-Key': '4Rfp2GEHDjgesA6MdseUM1n8B8kT9hgs',
'Authorization': 'Bearer WRONG',
'Content-Type': 'application/json',
'User-Agent': 'axios/0.21.4',
} as unknown) as AxiosRequestHeaders,
} as unknown as AxiosRequestHeaders,
baseURL: 'https://defender-api.openzeppelin.com/',
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
Expand Down Expand Up @@ -142,13 +142,13 @@ export const mockAxiosError: AxiosError = {
maxContentLength: -1,
maxBodyLength: -1,
data: undefined,
headers: ({
headers: {
'Accept': 'application/json, text/plain, */*',
'X-Api-Key': '4Rfp2GEHDjgesA6MdseUM1n8B8kT9hgs',
'Authorization': 'Bearer WRONG',
'Content-Type': 'application/json',
'User-Agent': 'axios/0.21.4',
} as unknown) as AxiosRequestHeaders,
} as unknown as AxiosRequestHeaders,
},
request: {
_eventsCount: 7,
Expand Down
4 changes: 2 additions & 2 deletions packages/deploy/src/api/block-explorer-api-key.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ describe('Block Explorer Api Key Client', () => {
key: 'random-key',
};
beforeEach(() => {
client = (new DeployClient({
client = new DeployClient({
apiKey: 'key',
apiSecret: 'secret',
}) as unknown) as TestClient<DeployClient>;
}) as unknown as TestClient<DeployClient>;
createAuthenticatedApi.mockClear();
});
describe('constructor', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/deploy/src/api/deployment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ describe('Deploy Client', () => {
verifySourceCode: true,
};
beforeEach(() => {
deployClient = (new DeployClient({
deployClient = new DeployClient({
apiKey: 'key',
apiSecret: 'secret',
}) as unknown) as TestClient<DeployClient>;
}) as unknown as TestClient<DeployClient>;
createAuthenticatedApi.mockClear();
});
describe('constructor', () => {
Expand Down
5 changes: 4 additions & 1 deletion packages/deploy/src/models/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export interface DeployContractRequest {
salt?: string;
verifySourceCode: boolean;
licenseType?: SourceCodeLicense;
/**
* @example { "contracts/Library.sol:LibraryName": "0x1234567890123456789012345678901234567890" }
*/
libraries?: DeployRequestLibraries;
constructorInputs?: (string | boolean | number)[];
constructorBytecode?: string;
Expand All @@ -48,7 +51,7 @@ export interface DeployContractRequest {
txOverrides?: TxOverrides;
}
export interface DeployRequestLibraries {
[k: string]: string;
[k: `${string}:${string}`]: string;
}

export interface DeploymentResponse {
Expand Down
28 changes: 5 additions & 23 deletions packages/monitor/src/api/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe('MonitorClient', () => {
};

beforeEach(() => {
monitor = (new MonitorClient({ apiKey: 'key', apiSecret: 'secret' }) as unknown) as TestMonitorClient;
monitor = new MonitorClient({ apiKey: 'key', apiSecret: 'secret' }) as unknown as TestMonitorClient;
createAuthenticatedApi.mockClear();

listBlockwatchersSpy = jest.spyOn(monitor, 'listBlockwatchers').mockImplementation(async () => [
Expand Down Expand Up @@ -185,17 +185,8 @@ describe('MonitorClient', () => {

describe('create', () => {
it('passes correct BLOCK type arguments to the API', async () => {
const {
name,
network,
paused,
type,
addresses,
abi,
txCondition,
eventConditions,
functionConditions,
} = createBlockPayload;
const { name, network, paused, type, addresses, abi, txCondition, eventConditions, functionConditions } =
createBlockPayload;

const expectedApiRequest = {
paused,
Expand Down Expand Up @@ -302,17 +293,8 @@ describe('MonitorClient', () => {
it('passes correct BLOCK type arguments to the API', async () => {
jest.spyOn(monitor, 'get').mockImplementation(async () => oldBlockMonitor);

const {
name,
network,
paused,
type,
addresses,
abi,
txCondition,
eventConditions,
functionConditions,
} = createBlockPayload;
const { name, network, paused, type, addresses, abi, txCondition, eventConditions, functionConditions } =
createBlockPayload;

const expectedApiRequest = {
paused,
Expand Down
2 changes: 1 addition & 1 deletion packages/network/src/api/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('NetworkClient', () => {
let networkClient: TestNetworkClient;

beforeEach(() => {
networkClient = (new NetworkClient({ apiKey: 'key', apiSecret: 'secret' }) as unknown) as TestNetworkClient;
networkClient = new NetworkClient({ apiKey: 'key', apiSecret: 'secret' }) as unknown as TestNetworkClient;
createAuthenticatedApi.mockClear();
});

Expand Down
2 changes: 1 addition & 1 deletion packages/proposal/src/models/simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type Log = [
Address | string[] | string,
Address | string[] | string,
Address | string[] | string,
...(Address | string[] | string)[]
...(Address | string[] | string)[],
];
export type BigUInt = string | string | number;

Expand Down
4 changes: 2 additions & 2 deletions packages/relay-signer/src/action/index-rate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ describe('ActionRelayer', () => {
let relayer: TestActionRelayer;

beforeEach(async function () {
relayer = (new ActionRelayer({
relayer = new ActionRelayer({
credentials: JSON.stringify(credentials),
relayerARN: 'arn',
}) as unknown) as TestActionRelayer;
}) as unknown as TestActionRelayer;
});

describe('get rate limited', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/relay-signer/src/action/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ describe('ActionRelayer', () => {
let relayer: TestActionRelayer;

beforeEach(async function () {
relayer = (new ActionRelayer({
relayer = new ActionRelayer({
credentials: JSON.stringify(credentials),
relayerARN: 'arn',
}) as unknown) as TestActionRelayer;
}) as unknown as TestActionRelayer;
});

describe('constructor', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/relay-signer/src/ethers/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ export class DefenderRelayProvider extends StaticJsonRpcProvider {
}

getSigner(): JsonRpcSigner {
return (new DefenderRelaySigner(this.relayer, this, {}) as any) as JsonRpcSigner;
return new DefenderRelaySigner(this.relayer, this, {}) as any as JsonRpcSigner;
}
}
Loading

0 comments on commit 5b0b43f

Please sign in to comment.