Make Block Weight Unit configurable in frontend+backend.

This commit is contained in:
softsimon
2021-07-31 17:30:35 +03:00
parent a32c1f40b1
commit 037f472f8c
12 changed files with 22 additions and 13 deletions

View File

@@ -28,6 +28,7 @@ export interface Env {
NGINX_PROTOCOL?: string;
NGINX_HOSTNAME?: string;
NGINX_PORT?: string;
BLOCK_WEIGHT_UNITS: number;
GIT_COMMIT_HASH: string;
PACKAGE_JSON_VERSION: string;
}
@@ -45,6 +46,7 @@ const defaultEnv: Env = {
'NGINX_PROTOCOL': 'http',
'NGINX_HOSTNAME': '127.0.0.1',
'NGINX_PORT': '80',
'BLOCK_WEIGHT_UNITS': 4000000,
'GIT_COMMIT_HASH': '',
'PACKAGE_JSON_VERSION': '',
};
@@ -55,6 +57,7 @@ const defaultEnv: Env = {
export class StateService {
isBrowser: boolean = isPlatformBrowser(this.platformId);
network = '';
blockVSize: number;
env: Env;
latestBlockHeight = 0;
@@ -113,6 +116,8 @@ export class StateService {
this.network = this.env.BASE_MODULE;
this.networkChanged$.next(this.env.BASE_MODULE);
}
this.blockVSize = this.env.BLOCK_WEIGHT_UNITS / 4;
}
setNetworkBasedonUrl(url: string) {