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
22e7cf17
Commit
22e7cf17
authored
10 months ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove account creation fee check
parent
56a6213e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#36817
failed
10 months ago
Stage: format
Stage: build_and_test
Stage: package
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/providers/substrate_sdk.dart
+0
-1
0 additions, 1 deletion
lib/providers/substrate_sdk.dart
lib/widgets/payment_popup.dart
+35
-18
35 additions, 18 deletions
lib/widgets/payment_popup.dart
pubspec.yaml
+1
-1
1 addition, 1 deletion
pubspec.yaml
with
36 additions
and
20 deletions
lib/providers/substrate_sdk.dart
+
0
−
1
View file @
22e7cf17
...
...
@@ -516,7 +516,6 @@ class SubstrateSdk with ChangeNotifier {
const
currencyParametersNames
=
{
'ss58'
:
'system.ss58Prefix.words'
,
'minCertForMembership'
:
'wot.minCertForMembership.words'
,
'newAccountPrice'
:
'account.newAccountPrice.words'
,
'existentialDeposit'
:
'balances.existentialDeposit.words'
,
'certPeriod'
:
'cert.certPeriod.words'
,
'certMaxByIssuer'
:
'cert.maxByIssuer.words'
,
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/payment_popup.dart
+
35
−
18
View file @
22e7cf17
...
...
@@ -60,6 +60,40 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
);
}
bool
canValidatePayment
()
{
final
payAmount
=
walletViewProvider
.
payAmount
.
text
;
if
(
payAmount
.
isEmpty
)
{
return
false
;
}
final
walletOptions
=
Provider
.
of
<
WalletOptionsProvider
>(
context
,
listen:
false
);
final
defaultWalletBalance
=
walletOptions
.
balanceCache
[
defaultWallet
.
address
]
??
0
;
const
existentialDeposit
=
2
;
final
double
payAmountValue
=
double
.
parse
(
payAmount
);
final
double
toAddressBalance
=
walletOptions
.
balanceCache
[
toAddress
]
??
0
;
// Prevent sending more than the balance with existential deposit
if
(
payAmountValue
/
balanceRatio
>
defaultWalletBalance
-
existentialDeposit
)
{
return
false
;
}
// Prevent sending to self
if
(
toAddress
==
defaultWallet
.
address
)
{
return
false
;
}
// Prevent sending to an empty wallet with less than 2 (existential deposit)
if
(
toAddressBalance
==
0
&&
payAmountValue
<
existentialDeposit
/
balanceRatio
)
{
return
false
;
}
return
true
;
}
myWalletProvider
.
readAllWallets
()
.
then
((
value
)
=
>
myWalletProvider
.
listWallets
.
sort
((
a
,
b
)
=
>
a
.
derivation
!.
compareTo
(
b
.
derivation
!
)));
...
...
@@ -74,27 +108,10 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
context:
context
,
builder:
(
BuildContext
context
)
{
final
sub
=
Provider
.
of
<
SubstrateSdk
>(
homeContext
,
listen:
false
);
final
walletOptions
=
Provider
.
of
<
WalletOptionsProvider
>(
context
,
listen:
false
);
return
StatefulBuilder
(
builder:
(
BuildContext
context
,
StateSetter
setState
)
{
if
(
walletViewProvider
.
payAmount
.
text
!=
''
&&
(
double
.
parse
(
walletViewProvider
.
payAmount
.
text
)
+
2
/
balanceRatio
)
<
=
(
walletOptions
.
balanceCache
[
defaultWallet
.
address
]
??
0
)
&&
toAddress
!=
defaultWallet
.
address
)
{
if
((
walletOptions
.
balanceCache
[
toAddress
]
==
0
||
walletOptions
.
balanceCache
[
toAddress
]
==
null
)
&&
double
.
parse
(
walletViewProvider
.
payAmount
.
text
)
<
5
/
balanceRatio
)
{
canValidate
=
false
;
}
else
{
canValidate
=
true
;
}
}
else
{
canValidate
=
false
;
}
canValidate
=
canValidatePayment
();
final
bool
isUdUnit
=
configBox
.
get
(
'isUdUnit'
)
??
false
;
return
Padding
(
padding:
EdgeInsets
.
only
(
...
...
This diff is collapsed.
Click to expand it.
pubspec.yaml
+
1
−
1
View file @
22e7cf17
...
...
@@ -5,7 +5,7 @@ description: Pay with G1.
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to
:
"
none"
# Remove this line if you wish to publish to pub.dev
version
:
0.1.6+7
3
version
:
0.1.6+7
4
environment
:
sdk
:
"
>=2.12.0
<3.0.0"
...
...
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