Skip to content

Commit

Permalink
update dot denomination
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeroYang committed Aug 21, 2020
1 parent bc59e06 commit 512e469
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 15 deletions.
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 0.9.5;
MARKETING_VERSION = 0.9.6;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -531,7 +531,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 0.9.5;
MARKETING_VERSION = 0.9.6;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -561,7 +561,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 0.9.5;
MARKETING_VERSION = 0.9.6;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.polkawallet;
PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down
10 changes: 5 additions & 5 deletions lib/common/consts/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ const String cross_chain_transfer_address_laminar =
'5CLaminarAUSDCrossChainTransferxxxxxxxxxxxxxwisu';

/// app versions
const String app_beta_version = '0.9.5-beta.1';
const String app_beta_version = '0.9.6-beta.1';

/// js code versions
const Map<String, int> js_code_version_map = {
network_name_polkadot: 9210,
network_name_kusama: 9210,
network_name_acala_mandala: 9210,
network_name_laminar_turbulence: 9210,
network_name_polkadot: 9610,
network_name_kusama: 9610,
network_name_acala_mandala: 9610,
network_name_laminar_turbulence: 9610,
};

/// graphql for laminar
Expand Down
6 changes: 6 additions & 0 deletions lib/js_service_acala/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,17 @@ async function subscribeMessage(section, method, params, msgChannel) {
});
}

async function getNetworkPropoerties() {
const chainProperties = await api.rpc.system.properties();
return chainProperties;
}

window.settings = {
test,
connect,
connectAll,
getNetworkConst,
getNetworkPropoerties,
subscribeMessage,
genLinks,
};
Expand Down
3 changes: 3 additions & 0 deletions lib/js_service_kusama/src/constants/networkSpect.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,6 @@ export const NETWORK_LIST = Object.freeze(
);

export const defaultNetworkKey = SubstrateNetworkKeys.KUSAMA;

export const POLKADOT_GENESIS =
"0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3";
12 changes: 12 additions & 0 deletions lib/js_service_kusama/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import staking from "./service/staking";
import gov from "./service/gov";
import claim from "./service/claim";
import { genLinks } from "./utils/config/config";
import { POLKADOT_GENESIS } from "./constants/networkSpect";

// send message to JSChannel: PolkaWallet
function send(path, data) {
Expand Down Expand Up @@ -93,11 +94,22 @@ async function subscribeMessage(section, method, params, msgChannel) {
});
}

async function getNetworkPropoerties() {
const chainProperties = await api.rpc.system.properties();
return api.genesisHash.toHuman() == POLKADOT_GENESIS
? api.registry.createType("ChainProperties", {
...chainProperties,
tokenDecimals: 10,
})
: chainProperties;
}

window.settings = {
test,
connect,
connectAll,
getNetworkConst,
getNetworkPropoerties,
changeEndpoint,
subscribeMessage,
genLinks,
Expand Down
6 changes: 6 additions & 0 deletions lib/js_service_laminar/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,17 @@ async function subscribeMessage(section, method, params, msgChannel) {
});
}

async function getNetworkPropoerties() {
const chainProperties = await api.rpc.system.properties();
return chainProperties;
}

window.settings = {
test,
connect,
connectAll,
getNetworkConst,
getNetworkPropoerties,
subscribeMessage,
};

Expand Down
2 changes: 1 addition & 1 deletion lib/page/account/txConfirmPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class _TxConfirmPageState extends State<TxConfirmPage> {
final bool isPolkadot =
store.settings.endpoint.info == network_name_polkadot;
bool isTxPaused = isPolkadot;
if (store.gov.bestNumber > 0 &&
if (isTxPaused && store.gov.bestNumber > 0 &&
(store.gov.bestNumber < dot_re_denominate_block - 1200 ||
store.gov.bestNumber > dot_re_denominate_block + 1200)) {
isTxPaused = false;
Expand Down
11 changes: 6 additions & 5 deletions lib/service/substrateApi/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class Api {
FlutterWebviewPlugin _web;
int _evalJavascriptUID = 0;

bool _jsCodeUpdated = false;

Function _connectFunc;

/// preload js code for opening dApps
Expand Down Expand Up @@ -234,7 +232,7 @@ class Api {
// fetch network info
List<dynamic> info = await Future.wait([
evalJavascript('settings.getNetworkConst()'),
evalJavascript('api.rpc.system.properties()'),
evalJavascript('settings.getNetworkPropoerties()'),
evalJavascript('api.rpc.system.chain()'),
]);
store.settings.setNetworkConst(info[0]);
Expand All @@ -243,8 +241,11 @@ class Api {

// fetch account balance
if (store.account.accountListAll.length > 0) {
if (store.settings.endpoint.info == networkEndpointAcala.info ||
store.settings.endpoint.info == networkEndpointLaminar.info) {
if (store.settings.endpoint.info == networkEndpointAcala.info) {
await assets.fetchBalance();
return;
}
if (store.settings.endpoint.info == networkEndpointLaminar.info) {
laminar.subscribeTokenPrices();
await assets.fetchBalance();
return;
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: 0.9.5+951
version: 0.9.6+961

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

0 comments on commit 512e469

Please sign in to comment.