-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(walletd): seed wallet send siacoin v2 transactions
- Loading branch information
1 parent
cf3a6b9
commit 0a937dd
Showing
40 changed files
with
1,991 additions
and
209 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'walletd': minor | ||
--- | ||
|
||
Seed wallets now support and automatically switch to sending V2 transactions once the consensus height hits the V2 hardfork allow height. |
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,74 @@ | ||
import { expect } from '@playwright/test' | ||
import { unlockOpenWallet } from './wallet' | ||
import { navigateToWallet } from './navigate' | ||
import { fillComposeTransactionSiacoin } from './sendSiacoinDialog' | ||
import { step, testRequiresClipboardPermissions } from '@siafoundation/e2e' | ||
|
||
export const sendSiacoinWithSeedWallet = step( | ||
'send siacoin with a seed wallet', | ||
async ( | ||
page, | ||
{ | ||
browserName, | ||
walletName, | ||
mnemonic, | ||
changeAddress, | ||
receiveAddress, | ||
amount, | ||
fee, | ||
}: { | ||
browserName: string | ||
walletName: string | ||
mnemonic: string | ||
changeAddress: string | ||
receiveAddress: string | ||
amount: number | ||
fee: number | ||
} | ||
) => { | ||
testRequiresClipboardPermissions(browserName) | ||
const amountWithFeeString = `${(amount + fee).toFixed(3)} SC` | ||
|
||
await navigateToWallet(page, walletName) | ||
await unlockOpenWallet(page, mnemonic) | ||
await page.getByLabel('send').click() | ||
await fillComposeTransactionSiacoin({ | ||
page, | ||
receiveAddress, | ||
changeAddress, | ||
amount, | ||
}) | ||
const sendDialog = page.getByRole('dialog', { name: 'Send' }) | ||
await expect( | ||
sendDialog.getByText('The wallet is currently unlocked') | ||
).toBeVisible() | ||
await expect(sendDialog.getByText('Total')).toBeVisible() | ||
await expect(sendDialog.getByText(amountWithFeeString)).toBeVisible() | ||
|
||
await page | ||
.getByRole('button', { name: 'Sign and broadcast transaction' }) | ||
.click() | ||
await expect( | ||
page.getByText('Transaction successfully broadcast') | ||
).toBeVisible() | ||
await expect(sendDialog.getByText(receiveAddress.slice(0, 5))).toBeVisible() | ||
await expect(sendDialog.getByText(changeAddress.slice(0, 5))).toBeVisible() | ||
await expect(sendDialog.getByText('Total')).toBeVisible() | ||
await expect(sendDialog.getByText(amountWithFeeString)).toBeVisible() | ||
await sendDialog.getByRole('button', { name: 'Close' }).click() | ||
|
||
await page.reload() | ||
await expect(page.getByTestId('eventsTable')).toBeVisible() | ||
await expect( | ||
page.getByTestId('eventsTable').locator('tbody tr').first() | ||
).toBeVisible() | ||
await expect( | ||
page | ||
.getByTestId('eventsTable') | ||
.locator('tbody tr') | ||
.first() | ||
.getByTestId('amount') | ||
.getByText(`-${amountWithFeeString}`) | ||
).toBeVisible() | ||
} | ||
) |
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
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
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.