-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: token migration portal #159
Open
fmorency
wants to merge
69
commits into
liftedinit:main
Choose a base branch
from
fmorency:token-migration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 64 commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
3f6ff01
feat(wip): token migration
fmorency 08934e1
feat(wip): migration form
fmorency 2044c9f
chore: remove poc files and fix import
fmorency 538dc62
feat(wip): token migration)
fmorency 6b7802a
fix: tests
fmorency d630665
feat(wip): token migration
fmorency d82dbbe
fix: asset amount
fmorency b18f07f
chore: code cleanup, refactor and general improvement
fmorency 22794ec
feat(wip): token migration
fmorency a9dbbb5
fix(wip): token migration
fmorency f414867
fix(wip): token migration in menu
fmorency 565420e
test: add basic token migration portal test
fmorency ea79534
chore: many-js 0.3.0
fmorency 1ca079c
fix: import path
fmorency e9a1578
feat(wip): token migration
fmorency 0ce7596
fix: warnings
fmorency 78c36b3
fix: error handling and formatting
fmorency 6c15de4
fix: migration details
fmorency 9755b3e
feat(wip): token migration
fmorency 14fbfce
feat(wip): token migration refactor and improvements
fmorency cd819a3
test: refactor account menu tests
fmorency 5d64dd6
test: close toasts
fmorency c950c33
test: refactor account-menu
fmorency da40d57
test: big refactor
fmorency da320af
ci: bump node
fmorency 81b6973
fix: overlapping act
fmorency 2631df1
fix: useIsBaseBreakpoint
fmorency 718b20b
test: bump edit and remove network timeout
fmorency f5cb4af
fix: import and buffer manip
fmorency 0bb8897
test: migration-banner test
fmorency c8ba528
test: migration-details test
fmorency 0aa2f99
fix: network-menu test timeout
fmorency cc075a5
test: migration-details error
fmorency b5a90ab
fix: out of bound test
fmorency db7ed6f
fix: build lint err
fmorency 9fd13d3
test: migration-form
fmorency 232341c
test: more token migration tests and fixes
fmorency 9b3de87
chore: move mocks around
fmorency 6b45077
fix: workaround stupid compiler
fmorency 6714278
fix: typescript jest error
fmorency 66aa435
test: finish account flow tests
fmorency 7584201
test: migration-list
fmorency e159134
fix: refactor uuid and fix big event ids
fmorency 3a5c712
fix: e2e tests
fmorency 5ea6df6
test: e2e tests
fmorency 8ade888
fix: tests
fmorency 66408fc
fix: big number handling
fmorency 3e48acf
Merge branch 'fix-bigint' into token-migration
fmorency ad3475f
Merge branch 'main' into token-migration
fmorency 12e10fb
fix: merge
fmorency 2d26e77
fix: use normal notation
fmorency 54873f3
fix: event id len
fmorency f73fc4a
Merge remote-tracking branch 'origin/main' into token-migration
fmorency c8d07b7
feat: manifest chain confirmation info
fmorency e68956f
fix: timeout and console debug
fmorency 39faa40
fix: bump test timeout
fmorency 8807e88
fix: query caching issue
fmorency 96ce485
fix: cleanup and dry
fmorency ca406b6
test: new chain details
fmorency 6627bbe
chore: remove TODO
fmorency 9f3e270
fix: migration form test
fmorency a986a14
chore: remove todos
fmorency 9a300b3
chore: todo and polishing
fmorency 374361b
fix: descriptions and confirmation checkbox
fmorency 8c0c46b
chore: update staging talib url
fmorency 4a3b012
Merge remote-tracking branch 'origin/main' into token-migration
fmorency 7a3c32f
fix: enable all assets
fmorency 57c81bd
fix: minimum amount
fmorency edd9e53
fix: qa talib neighborhood id
fmorency File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
REACT_APP_WEB3AUTH_NETWORK=cyan | ||
REACT_APP_WEB3AUTH_CLIENTID=BLlqF8V3D0hLGDBfedOKvBXEZMYsdJB5kMX2GNCyXB5ZMU1enVyciGhgihBqW8E6NTaeZO182nF8zMiiMd1cAmk | ||
REACT_APP_WEB3AUTH_CLIENTID=BLlqF8V3D0hLGDBfedOKvBXEZMYsdJB5kMX2GNCyXB5ZMU1enVyciGhgihBqW8E6NTaeZO182nF8zMiiMd1cAmk | ||
REACT_APP_TALIB_URL="https://talib.liftedinit.app/api/v1/neighborhoods/6/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
REACT_APP_WEB3AUTH_NETWORK=testnet | ||
REACT_APP_WEB3AUTH_CLIENTID=BKj3lr6GfN2CnvO4CIKo5fuoCg_TpHsAPK7R8lbl6kUlz0CAH_5mFNswScEb7M6szV4hd1Tkwa2oPZ9KiXJB-44 | ||
REACT_APP_WEB3AUTH_CLIENTID=BKj3lr6GfN2CnvO4CIKo5fuoCg_TpHsAPK7R8lbl6kUlz0CAH_5mFNswScEb7M6szV4hd1Tkwa2oPZ9KiXJB-44 | ||
REACT_APP_TALIB_URL="http://localhost:3001/api/v1/neighborhoods/1/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
MAIN_WALLET_PEM="-----BEGIN PRIVATE KEY-----MC4CAQAwBQYDK2VwBCIEIHcoTY2RYa48O8ONAgfxEw+15MIyqSat0/QpwA1YxiPD-----END PRIVATE KEY-----" | ||
WALLET_1_SEED="shallow abstract tail attend public right modify awesome limb media toward other" | ||
WALLET_2_SEED="warrior wrist okay work pave destroy coral baby blouse rhythm prepare caught" | ||
WALLET_3_SEED="burden name asset report require crouch risk escape clutch spike gas wet" | ||
WALLET_3_SEED="burden name asset report require crouch risk escape clutch spike gas wet" | ||
DESTINATION_ADDRESS="manifest1q9d53rh7gq2cjq2j0nk7n0rj9qjwvnmywchg6n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import { Locator, Page, expect } from "@playwright/test" | ||
|
||
export class TokenMigration { | ||
readonly page: Page | ||
readonly url = "/#/token-migration-portal" | ||
readonly createNewMigrationButton: Locator | ||
readonly migrationHistoryButton: Locator | ||
readonly sourceAddressSelect: Locator | ||
readonly userAddressSelect: Locator // Only used in the Account use-case | ||
readonly destinationAddressInput: Locator | ||
readonly amountInput: Locator | ||
readonly amountType: Locator | ||
readonly nextButton: Locator | ||
|
||
constructor(page: Page) { | ||
this.page = page | ||
this.createNewMigrationButton = this.page.locator( | ||
'[aria-label="create-new-migration-btn"]', | ||
) | ||
this.migrationHistoryButton = this.page.locator( | ||
'[aria-label="view-migration-history-btn"]', | ||
) | ||
this.sourceAddressSelect = this.page.locator( | ||
'[aria-label="user-account-address"]', | ||
) | ||
this.userAddressSelect = this.page.locator('[aria-label="user-address"]') | ||
this.destinationAddressInput = this.page.locator( | ||
'[aria-label="destination-address"]', | ||
) | ||
this.amountType = this.page.locator('[aria-label="select-asset-type"]') | ||
this.amountInput = this.page.locator('[aria-label="select-asset-amount"]') | ||
this.nextButton = this.page.locator('[data-testid="next-btn"]') | ||
} | ||
|
||
async goto() { | ||
await this.page.goto(this.url) | ||
} | ||
|
||
async createMigration( | ||
from: string, | ||
destination: string, | ||
amount: string, | ||
denom: string, | ||
maybeUserAddress?: string, | ||
) { | ||
await this.goto() | ||
await this.createNewMigrationButton.click() | ||
await this.sourceAddressSelect.selectOption({ | ||
value: from, | ||
}) | ||
await this.nextButton.click() | ||
|
||
// Account use-case | ||
if (from.length === 55 && maybeUserAddress !== undefined) { | ||
await this.userAddressSelect.selectOption({ | ||
value: maybeUserAddress, | ||
}) | ||
await this.nextButton.click() | ||
} | ||
|
||
await this.amountType.selectOption({ label: denom }) | ||
await this.amountInput.fill(amount) | ||
await this.nextButton.click() | ||
|
||
await this.destinationAddressInput.fill(destination) | ||
await this.nextButton.click() | ||
|
||
await this.page.waitForSelector('[data-testid="confirmation-box"]') | ||
await this.nextButton.click() | ||
|
||
await this.page.waitForURL("/#/token-migration-portal/migration-history/*") | ||
|
||
return await this.page.locator('[aria-label="uuid"]').textContent() | ||
} | ||
|
||
async verifyMigrationInHistory(uuid: string, address: string) { | ||
await this.goto() | ||
await this.migrationHistoryButton.click() | ||
await this.sourceAddressSelect.selectOption({ | ||
value: address, | ||
}) | ||
await this.page.waitForSelector(`[aria-label="${uuid}"]`) | ||
const uuidElement = await this.page | ||
.locator(`[aria-label="${uuid}"]`) | ||
.textContent() | ||
expect(uuidElement).toBe(uuid) | ||
} | ||
|
||
async verifyExecutedMultiSigMigrationInHistory( | ||
uuid: string, | ||
address: string, | ||
) { | ||
await this.goto() | ||
await this.migrationHistoryButton.click() | ||
await this.sourceAddressSelect.selectOption({ | ||
value: address, | ||
}) | ||
const elements = await this.page.$$(`[aria-label="${uuid}"]`) | ||
expect(elements.length).toBe(2) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please change staging env talib_url to "https://qa-talib.liftedinit.app/api/v1/neighborhoods/2/" and rebuild?