Skip to content

Commit

Permalink
Merge pull request #117 from OpenZeppelin/plat-2592-support-for-scrol…
Browse files Browse the repository at this point in the history
…l-network

Add support for scroll sepolia network
  • Loading branch information
MCarlomagno authored Oct 11, 2023
2 parents 30199f7 + 479f86d commit 66eff5d
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 43 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
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
5 changes: 4 additions & 1 deletion packages/base/src/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export type PublicNetwork =
| 'base-goerli'
| 'linea-goerli'
| 'linea'
| 'mantle';
| 'mantle'
| 'scroll-sepolia';
export type CustomNetwork = 'x-dfk-avax-chain' | 'x-dfk-avax-chain-test' | 'x-security-alliance';
export type ForkedNetwork = string;

Expand Down Expand Up @@ -84,6 +85,7 @@ export const Networks: Network[] = [
'x-dfk-avax-chain-test',
'x-security-alliance',
'mantle',
'scroll-sepolia',
];

export function isValidNetwork(text: string): text is Network {
Expand Down Expand Up @@ -139,4 +141,5 @@ const chainIds: { [key in Network]: number } = {
'x-dfk-avax-chain-test': 335,
'x-security-alliance': 888,
'mantle': 5000,
'scroll-sepolia': 534351,
};
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
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 @@ -184,17 +184,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 @@ -301,17 +292,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 @@ -27,7 +27,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;
}
}

0 comments on commit 66eff5d

Please sign in to comment.