Skip to content
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

436 feature complete type checks on token transactions #459

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
49a3d57
fixed: type check for transaction functions
zzggo Feb 3, 2025
352b572
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
zzggo Feb 4, 2025
1830175
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
zzggo Feb 4, 2025
a9f60e1
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
zzggo Feb 5, 2025
43d7ba4
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
zzggo Feb 5, 2025
47362e4
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
zzggo Feb 6, 2025
c2943a9
fixed: create transaction type and restructure the send folder
zzggo Feb 6, 2025
ae6c5e6
feat: set transaction state type
zzggo Feb 6, 2025
7f5451f
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
zzggo Feb 7, 2025
c0afe2a
feat: check decimal places sending to env
zzggo Feb 7, 2025
1bd97ed
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
zzggo Feb 7, 2025
e07a747
feat: set token transfer digit limits sending to flow
zzggo Feb 8, 2025
4b3858c
fixed: selected token default as flow, no null value allowed
zzggo Feb 8, 2025
3df9bfd
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
zzggo Feb 9, 2025
7bcb3fb
feat: add decimal checks on move tokens
zzggo Feb 9, 2025
df6aa29
fixed: transaction ui update and change the function handler to globa…
zzggo Feb 10, 2025
7f6dbb2
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
zzggo Feb 10, 2025
8c1e823
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
zzggo Feb 11, 2025
37c5123
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
zzggo Feb 11, 2025
44c9d57
Transaction reducer example
tombeckenham Feb 11, 2025
0b895f6
Scoped actions and removed imports
tombeckenham Feb 11, 2025
052f1a7
Corrected number entry and a couple of tests
tombeckenham Feb 12, 2025
f44f547
Merge pull request #498 from onflow:transaction-reducer
tombeckenham Feb 12, 2025
5a9740a
Updated Mapping to capitalize From To and moved TransferConfirmation …
tombeckenham Feb 12, 2025
d7712cb
Feat: add contact hook and store
zzggo Feb 12, 2025
f8177f9
feat: move the address list into store
zzggo Feb 12, 2025
35c98dd
feat: new web3 instance
zzggo Feb 12, 2025
b5104eb
Updated SendToEvm and confirmations
tombeckenham Feb 12, 2025
25c6c4e
Corrected address lookup redirect
tombeckenham Feb 12, 2025
5ec6f64
fixed: change to useContact, fixed the address check and rerendering …
zzggo Feb 12, 2025
18bf153
Merge branches '436-feature-complete-type-checks-on-token-transaction…
zzggo Feb 12, 2025
d93e6d4
EVM confirm in progress
tombeckenham Feb 12, 2025
4222512
Transitioned all send components to use reducer
tombeckenham Feb 13, 2025
266d59f
Changed routing structure for token sends
tombeckenham Feb 13, 2025
f13d4e7
Combined SendToEvm and SendToCadence
tombeckenham Feb 13, 2025
b0c5630
Consolidated all send functionality
tombeckenham Feb 13, 2025
6e963e9
feat: new contact card
zzggo Feb 13, 2025
67da668
Merge branch '436-feature-complete-type-checks-on-token-transactions'…
zzggo Feb 13, 2025
718209c
fixed: update profile with generic component passing in contact object
zzggo Feb 13, 2025
47c4f0e
fixed: move the set state out from component
zzggo Feb 13, 2025
7ac3ef9
fixed: select the store and set to a new object individually
zzggo Feb 13, 2025
bd907ee
Moved all the listen transaction stuff to the one function
tombeckenham Feb 13, 2025
a9b2a0a
Updating to call setAmount when changing tokens to adjust the decimals
tombeckenham Feb 13, 2025
93e6145
Removed value checking and manipulation from individual functions as …
tombeckenham Feb 13, 2025
76b61e1
Removed all the move FT stuff
tombeckenham Feb 13, 2025
b8dc375
Moved all transaction logic to the background 🎉
tombeckenham Feb 13, 2025
02b5ca5
Added tests for transaction reducer
tombeckenham Feb 13, 2025
1f5caa8
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
tombeckenham Feb 13, 2025
982327a
Corrected some of the tests
tombeckenham Feb 13, 2025
0e243c4
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
tombeckenham Feb 14, 2025
f4197fa
Removed code that altered values in wallet. Moved some code to number…
tombeckenham Feb 14, 2025
e5ab5be
Removed unused code and providers
tombeckenham Feb 14, 2025
3e7aaae
Removed temp code from webpack
tombeckenham Feb 14, 2025
0373993
Merge branch 'dev' into 436-feature-complete-type-checks-on-token-tra…
tombeckenham Feb 14, 2025
fc033ad
Returns empty string if empty string passed in
tombeckenham Feb 14, 2025
d05537a
Added metamask EOA address
tombeckenham Feb 14, 2025
36f8b03
fixed: return the contact card with icons first
zzggo Feb 14, 2025
f4e0bf4
Corrected evm transaction coversion to integer, and coin selector
tombeckenham Feb 14, 2025
ae3a72b
Merge remote-tracking branch 'refs/remotes/origin/436-feature-complet…
tombeckenham Feb 14, 2025
f95f71a
Corrected flow token coa transaction. Checks transaction amount in e2…
tombeckenham Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:
TEST_SEED_PHRASE_SENDER="${{ secrets.TEST_SEED_PHRASE_SENDER }}"
TEST_SENDER_ADDR="${{ secrets.TEST_SENDER_ADDR }}"
TEST_RECEIVER_ADDR="${{ secrets.TEST_RECEIVER_ADDR }}"
TEST_RECEIVER_EVM_ADDR="${{ secrets.TEST_RECEIVER_EVM_ADDR }}"
TEST_RECEIVER_METAMASK_EVM_ADDR="${{ secrets.TEST_RECEIVER_METAMASK_EVM_ADDR }}"
EOF

- name: Run tests
Expand Down Expand Up @@ -138,6 +140,7 @@ jobs:
TEST_RECEIVER_ADDR="${{ secrets.TEST_RECEIVER_ADDR }}"
TEST_SENDER_EVM_ADDR="${{ secrets.TEST_SENDER_EVM_ADDR }}"
TEST_RECEIVER_EVM_ADDR="${{ secrets.TEST_RECEIVER_EVM_ADDR }}"
TEST_RECEIVER_METAMASK_EVM_ADDR="${{ secrets.TEST_RECEIVER_METAMASK_EVM_ADDR }}"
EOF
- name: Install pnpm
uses: pnpm/action-setup@v4
Expand Down
9 changes: 7 additions & 2 deletions e2e/sendTransaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ test('send Flow COA to COA', async ({ page }) => {
tokenname: /^FLOW \$/i,
receiver: process.env.TEST_RECEIVER_EVM_ADDR!,
successtext: 'success',
amount: '0.12345678', // 8 decimal places
});
});

Expand All @@ -95,6 +96,7 @@ test('send Flow COA to FLOW', async ({ page }) => {
tokenname: /^FLOW \$/i,
receiver: process.env.TEST_RECEIVER_ADDR!,
successtext: 'success',
amount: '0.00123456', // 8 decimal places
});
});

Expand All @@ -105,6 +107,7 @@ test('send USDC token COA to FLOW', async ({ page }) => {
tokenname: 'Bridged USDC (Celer) $',
receiver: process.env.TEST_RECEIVER_ADDR!,
successtext: 'success',
amount: '0.002468', // 6 decimal places
});
});

Expand All @@ -117,6 +120,7 @@ test('send Flow COA to EOA', async ({ page }) => {
tokenname: /^FLOW \$/i,
receiver: process.env.TEST_RECEIVER_METAMASK_EVM_ADDR!,
successtext: 'success',
amount: '0.00123456', // 8 decimal places
});
});

Expand All @@ -127,9 +131,10 @@ test('send BETA token COA to EOA', async ({ page }) => {
tokenname: 'BETA $',
receiver: process.env.TEST_RECEIVER_METAMASK_EVM_ADDR!,
successtext: 'success',
amount: '0.001234567890123456', // 8 decimal places
});
});
//Move FTs from COA to FLOW
/* //Move FTs from COA to FLOW
test('move Flow COA to FLOW', async ({ page }) => {
// Move FLOW token from COA to FLOW
await moveTokenCOA({
Expand Down Expand Up @@ -164,7 +169,7 @@ test('move USDC token COA to FLOW homepage', async ({ page }) => {
tokenname: 'Bridged USDC (Celer)',
amount: '0.000123',
});
});
}); */
//Send NFT from COA to COA
//Send NFT from COA to FLOW
//Send NFT from COA to EOA
Expand Down
9 changes: 8 additions & 1 deletion e2e/sendTransactionFromFlow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ test('send FLOW flow to flow', async ({ page }) => {
page,
tokenname: /^FLOW \$/i,
receiver: process.env.TEST_RECEIVER_ADDR!,
amount: '0.00123456',
});
});

Expand All @@ -83,6 +84,7 @@ test('send stFlow flow to flow', async ({ page }) => {
page,
tokenname: 'Liquid Staked Flow $',
receiver: process.env.TEST_RECEIVER_ADDR!,
amount: '0.00123456',
});
});

Expand All @@ -93,6 +95,7 @@ test('send FLOW flow to COA', async ({ page }) => {
page,
tokenname: /^FLOW \$/i,
receiver: process.env.TEST_RECEIVER_EVM_ADDR!,
amount: '0.00123456',
});
});
//Send USDC from Flow to Flow
Expand All @@ -102,6 +105,7 @@ test('send USDC flow to COA', async ({ page }) => {
tokenname: 'USDC.e (Flow) $',
receiver: process.env.TEST_RECEIVER_EVM_ADDR!,
ingoreFlowCharge: true,
amount: '0.00123456',
});
});

Expand All @@ -112,6 +116,7 @@ test('send FLOW flow to EOA', async ({ page }) => {
page,
tokenname: /^FLOW \$/i,
receiver: process.env.TEST_RECEIVER_METAMASK_EVM_ADDR!,
amount: '0.00123456',
});
});

Expand All @@ -122,9 +127,10 @@ test('send BETA flow to EOA', async ({ page }) => {
tokenname: 'BETA $',
receiver: process.env.TEST_RECEIVER_METAMASK_EVM_ADDR!,
ingoreFlowCharge: true,
amount: '0.00123456',
});
});
//Move FTs from Flow to COA
/* //Move FTs from Flow to COA
test('move Flow Flow to COA', async ({ page }) => {
// Move FLOW token from FLOW to COA
await moveTokenFlow({
Expand Down Expand Up @@ -160,3 +166,4 @@ test('move USDC token Flow to COA homepage', async ({ page }) => {
ingoreFlowCharge: true,
});
});
*/
18 changes: 9 additions & 9 deletions e2e/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,27 +452,27 @@ export const waitForTransaction = async ({
const progressBar = page.getByRole('progressbar');
await expect(progressBar).toBeVisible();
// Get the pending item with the cadence txId that was put in the url and status is pending
const pendingItem = page
.getByTestId(new RegExp(`^.*${txId}.*${ingoreFlowCharge ? '(?<!FlowToken)' : ''}$`))
.filter({ hasText: 'Pending' });

const activityItemRegexp = new RegExp(`^.*${txId}.*${ingoreFlowCharge ? '(?<!FlowToken)' : ''}$`);
const pendingItem = page.getByTestId(activityItemRegexp).filter({ hasText: 'Pending' });

await expect(pendingItem).toBeVisible({
timeout: 60_000,
});
await expect(progressBar).not.toBeVisible({ timeout: 60_000 });

// Get the executed item with the cadence txId that was put in the url and status is success
const executedItem = page
.getByTestId(new RegExp(`^.*${txId}.*${ingoreFlowCharge ? '(?<!FlowToken)' : ''}$`))
.filter({ hasText: successtext });
const executedItem = page.getByTestId(activityItemRegexp).filter({ hasText: successtext });

await expect(executedItem).toBeVisible({
timeout: 60_000,
});

// if (amount) {
// await expect(executedItem).toContainText(amount);
// }
if (amount) {
await expect(
page.getByTestId(activityItemRegexp).getByTestId(`token-value-${amount}`)
).toBeVisible();
}
};

export const expect = test.expect;
Loading
Loading