Skip to content

Commit

Permalink
Merge pull request #1762 from Giveth/feat/stellar_integration
Browse files Browse the repository at this point in the history
Fix: handle Stellar chain for project verification
  • Loading branch information
Meriem-BM authored Aug 14, 2024
2 parents aea8862 + f1421e4 commit 85557a3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/entities/projectVerificationForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export class FormRelatedAddress {
@Field({ nullable: true })
address: string;
@Field({ nullable: true })
memo?: string;
@Field({ nullable: true })
networkId: number;
@Field(_type => ChainType, { defaultValue: ChainType.EVM, nullable: true })
chainType?: ChainType;
Expand Down
8 changes: 8 additions & 0 deletions src/resolvers/projectVerificationFormResolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
generateConfirmationEmailToken,
generateRandomEtheriumAddress,
generateRandomSolanaAddress,
generateRandomStellarAddress,
generateTestAccessToken,
graphqlUrl,
saveProjectDirectlyToDb,
Expand Down Expand Up @@ -352,6 +353,13 @@ function updateProjectVerificationFormMutationTestCases() {
title: 'test title',
chainType: ChainType.EVM,
},
{
address: generateRandomStellarAddress(),
networkId: NETWORK_IDS.STELLAR_MAINNET,
title: 'test title',
chainType: ChainType.STELLAR,
memo: '123123',
},
// {
// address: generateRandomSolanaAddress(),
// networkId: NETWORK_IDS.SOLANA_MAINNET,
Expand Down
5 changes: 4 additions & 1 deletion src/utils/validators/graphqlQueryValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ const managingFundsValidator = Joi.object({
address: Joi.alternatives().try(
Joi.string().required().pattern(ethereumWalletAddressRegex),
Joi.string().required().pattern(solanaWalletAddressRegex),
Joi.string().required().pattern(stellarWalletAddressRegex),
),
memo: Joi.string().allow('', null).max(24),
networkId: Joi.number()?.valid(
0, // frontend may send 0 as a network id for solana, so we should allow it
NETWORK_IDS.SOLANA_MAINNET, // Solana
Expand All @@ -262,9 +264,10 @@ const managingFundsValidator = Joi.object({
NETWORK_IDS.XDAI,
NETWORK_IDS.ETC,
NETWORK_IDS.MORDOR_ETC_TESTNET,
NETWORK_IDS.STELLAR_MAINNET,
),
chainType: Joi.string()
.valid(ChainType.EVM, ChainType.SOLANA)
.valid(ChainType.EVM, ChainType.SOLANA, ChainType.STELLAR)
.default(ChainType.EVM),
}),
),
Expand Down

0 comments on commit 85557a3

Please sign in to comment.