Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ğecko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Ğecko
Commits
2f0604bb
Commit
2f0604bb
authored
3 months ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
can empty wallet
parent
e4f64116
No related branches found
No related tags found
No related merge requests found
Pipeline
#39052
failed
3 months ago
Stage: format
Stage: build_and_test
Stage: package
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/providers/substrate_sdk.dart
+4
-1
4 additions, 1 deletion
lib/providers/substrate_sdk.dart
lib/widgets/payment_popup.dart
+1
-1
1 addition, 1 deletion
lib/widgets/payment_popup.dart
with
5 additions
and
2 deletions
lib/providers/substrate_sdk.dart
+
4
−
1
View file @
2f0604bb
...
...
@@ -917,6 +917,7 @@ class SubstrateSdk with ChangeNotifier {
Future
<
void
>
pay
(
{
required
String
fromAddress
,
required
String
destAddress
,
required
double
amount
,
required
String
password
,
required
String
transactionId
})
async
{
final
walletOptions
=
Provider
.
of
<
WalletOptionsProvider
>(
homeContext
,
listen:
false
);
final
sender
=
await
_setSender
(
fromAddress
);
final
globalBalance
=
await
getBalance
(
fromAddress
);
...
...
@@ -928,7 +929,9 @@ class SubstrateSdk with ChangeNotifier {
late
String
call
;
late
String
tx2
;
if
(
amount
==
-
1
)
{
final
defaultWalletBalance
=
walletOptions
.
balanceCache
[
fromAddress
]
??
0
;
if
(
amount
==
-
1
||
amount
==
defaultWalletBalance
)
{
palette
=
'balances'
;
call
=
'transferAll'
;
txOptions
=
[
destAddress
,
false
];
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/payment_popup.dart
+
1
−
1
View file @
2f0604bb
...
...
@@ -68,7 +68,7 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
final
double
toAddressBalance
=
walletOptions
.
balanceCache
[
toAddress
]
??
0
;
// Prevent sending more than the balance with existential deposit
if
(
payAmountValue
/
balanceRatio
>
defaultWalletBalance
-
existentialDeposit
)
{
if
(
payAmountValue
/
balanceRatio
>
defaultWalletBalance
-
existentialDeposit
&&
defaultWalletBalance
!=
payAmountValue
)
{
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment