Skip to content

Commit

Permalink
fix(e2e-tests): add e2e-tests for /accounts/{accoundId}/validate (#731
Browse files Browse the repository at this point in the history
)

* add ValidateAddressService

* add ValidateAddressController

* add AccountsValidate to polkadot, westend, and kusama

* imports

* add kusama chain config

* fix response

* fix networkInfo bug

* lint

* get tests started

* change the name of the service

* cleanup, lint, fix build, test boilerplate

* update the tests

* more tests

* use hexToU8a for hex conversion

* add tests for hex values

* cleanup

* docs

* e2e tests for validate

* update e2e responses

* update docs

* Update docs/src/openapi-v1.yaml

Co-authored-by: David <dvdplm@gmail.com>

* docs

Co-authored-by: David <dvdplm@gmail.com>
  • Loading branch information
TarikGul and dvdplm committed Oct 27, 2021
1 parent ac48534 commit 2f115b3
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/dist/app.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/src/openapi-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ paths:
type: string
responses:
"200":
description: successful operation
description: successfully retrieved address info
content:
application/json:
schema:
Expand Down
2 changes: 2 additions & 0 deletions e2e-tests/endpoints/kusama/accounts/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { kusamaAccountBalanceEndpoints } from './balance-info';
import { kusamaAccountValidateEndpoints } from './validate';
import { kusamaAccountVestingInfoEndpoints } from './vesting-info';

export const kusamaAccountsEndpoints = [
...kusamaAccountBalanceEndpoints,
...kusamaAccountVestingInfoEndpoints,
...kusamaAccountValidateEndpoints,
];
14 changes: 14 additions & 0 deletions e2e-tests/endpoints/kusama/accounts/validate/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import validKusama from './validKusama.json';

const validKusamaStringify = JSON.stringify(validKusama);

export const kusamaAccountValidateEndpoints = [
[
'/accounts/DXgXPAT5zWtPHo6FhVvrDdiaDPgCNGxhJAeVBYLtiwW9hAc/validate',
validKusamaStringify,
],
[
'/accounts/0x02ce046d43fc4c0fb8b3b754028515e5020f5f1d8d620b4ef0f983c5df34b1952909e9/validate',
validKusamaStringify,
],
];
4 changes: 4 additions & 0 deletions e2e-tests/endpoints/kusama/accounts/validate/validKusama.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"isValid": true,
"ss58Prefix": "2"
}
2 changes: 2 additions & 0 deletions e2e-tests/endpoints/polkadot/accounts/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { polkadotAccountBalanceEndpoints } from './balance-info';
import { polkadotAccountValidateEndpoints } from './validate';
import { polkadotAccountVestingInfoEndpoints } from './vesting-info';

export const polkadotAccountsEndpoints = [
...polkadotAccountBalanceEndpoints,
...polkadotAccountVestingInfoEndpoints,
...polkadotAccountValidateEndpoints,
];
14 changes: 14 additions & 0 deletions e2e-tests/endpoints/polkadot/accounts/validate/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import validPolkadot from './validPolkadot.json';

const validPolkadotStringify = JSON.stringify(validPolkadot);

export const polkadotAccountValidateEndpoints = [
[
'/accounts/1xN1Q5eKQmS5AzASdjt6R6sHF76611vKR4PFpFjy1kXau4m/validate',
validPolkadotStringify,
],
[
'/accounts/0x002a39366f6620a6c2e2fed5990a3d419e6a19dd127fc7a50b515cf17e2dc5cc592312/validate',
validPolkadotStringify,
],
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"isValid": true,
"ss58Prefix": "0"
}
2 changes: 2 additions & 0 deletions e2e-tests/endpoints/westend/accounts/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { westendAccountBalanceEndpoints } from './balance-info';
import { westendAccountValidateEndpoints } from './validate';
import { westendAccountVestingInfoEndpoints } from './vesting-info';

export const westendAccountsEndpoints = [
...westendAccountBalanceEndpoints,
...westendAccountVestingInfoEndpoints,
...westendAccountValidateEndpoints,
];
14 changes: 14 additions & 0 deletions e2e-tests/endpoints/westend/accounts/validate/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import validWestend from './validWestend.json';

const validWestendStringify = JSON.stringify(validWestend);

export const westendAccountValidateEndpoints = [
[
'/accounts/5CdnmxQUfK6WPreBauvetcLh5PZL4RMPHrtd3nPQpQ9Z2qCS/validate',
validWestendStringify,
],
[
'/accounts/0x2a193ba804b76499944080c91b8b38b749a482471c317ab8bfa43f52d5ff9c04c7f6bf/validate',
validWestendStringify,
],
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"isValid": true,
"ss58Prefix": "42"
}

0 comments on commit 2f115b3

Please sign in to comment.