Skip to content

Commit

Permalink
Merge pull request #962 from Giveth/fix/optimism_support
Browse files Browse the repository at this point in the history
Fixed changes to support optimism OP and ETH native token
  • Loading branch information
aminlatifi authored Apr 17, 2023
2 parents f116c8e + 6be5156 commit 430a328
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions migration/data/seedTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,13 @@ const seedTokens: ITokenData[] = [
// OPTIMISTIC tokens
{
name: 'OPTIMISTIC native token',
symbol: 'ETH',
address: '0x0000000000000000000000000000000000000000',
decimals: 18,
networkId: NETWORK_IDS.OPTIMISTIC,
},
{
name: 'OPTIMISTIC OP token',
symbol: 'OP',
address: '0x4200000000000000000000000000000000000042',
decimals: 18,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/validators/graphqlQueryValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const resourcePerDateRegex = new RegExp(

const ethereumWalletAddressRegex = /^0x[a-fA-F0-9]{40}$/;
const txHashRegex = /^0x[a-fA-F0-9]{64}$/;
const tokenSymbolRegex = /^[a-zA-Z0-9]{3,10}$/;
const tokenSymbolRegex = /^[a-zA-Z0-9]{2,10}$/; // OPTIMISTIC OP token is 2 chars long

export const validateWithJoiSchema = (data: any, schema: ObjectSchema) => {
const validationResult = schema.validate(data);
Expand Down
6 changes: 6 additions & 0 deletions test/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,12 @@ export const SEED_DATA = {
optimistic: [
{
name: 'OPTIMISTIC native token',
symbol: 'ETH',
address: '0x0000000000000000000000000000000000000000',
decimals: 18,
},
{
name: 'OPTIMISTIC OP token',
symbol: 'OP',
address: '0x4200000000000000000000000000000000000042',
decimals: 18,
Expand Down

0 comments on commit 430a328

Please sign in to comment.