Skip to content

Commit

Permalink
fix staking account.isStash check
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeroYang committed Sep 23, 2020
1 parent 27a1a3c commit 49f16d7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -518,7 +518,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -548,7 +548,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
4 changes: 2 additions & 2 deletions lib/common/consts/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ const String cross_chain_transfer_address_laminar =
'5CLaminarAUSDCrossChainTransferxxxxxxxxxxxxxwisu';

/// app versions
const String app_beta_version = 'v1.0.3-beta.2';
const int app_beta_version_code = 1032;
const String app_beta_version = 'v1.0.3-beta.3';
const int app_beta_version_code = 1033;

/// js code versions
const Map<String, int> js_code_version_map = {
Expand Down
7 changes: 5 additions & 2 deletions lib/page/staking/actions/actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,11 @@ class _StakingActions extends State<StakingActions>
bool isSelfControl = true;
String account02PubKey = store.account.currentAccountPubKey;
if (hasData) {
isStash = store.staking.ownStashInfo.stashId ==
store.staking.ownStashInfo.account.accountId;
// we assume an address is stash if it's stakingData
// is empty (!isOwnStash && !isOwnController).
isStash = store.staking.ownStashInfo.isOwnStash ||
(!store.staking.ownStashInfo.isOwnStash &&
!store.staking.ownStashInfo.isOwnController);
isController = store.staking.ownStashInfo.isOwnController;
isSelfControl = isStash && isController;

Expand Down
6 changes: 4 additions & 2 deletions lib/page/staking/validators/overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,18 @@ class _StakingOverviewPageState extends State<StakingOverviewPage>
List nominators = [];
double nominatorListHeight = 48;
bool isController = false;
bool isStash = true;
if (hashData) {
bonded = store.staking.ownStashInfo.stakingLedger['active'];
nominators = store.staking.ownStashInfo.nominating.toList();
if (nominators.length > 0) {
nominatorListHeight = double.parse((nominators.length * 56).toString());
}
isController = store.staking.ownStashInfo.isOwnController;
isStash = store.staking.ownStashInfo.isOwnStash ||
(!store.staking.ownStashInfo.isOwnStash &&
!store.staking.ownStashInfo.isOwnController);
}
final isStash = store.staking.ownStashInfo?.stashId ==
store.staking.ownStashInfo?.account?.accountId;

Color actionButtonColor = Theme.of(context).primaryColor;
Color disabledColor = Theme.of(context).disabledColor;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: PolkaWallet made with Flutter.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.3+1032
version: 1.0.3+1033

environment:
sdk: ">=2.7.0 <3.0.0"
Expand Down

0 comments on commit 49f16d7

Please sign in to comment.