kunickyd преди 3 години
родител
ревизия
bffe5e84c2
променени са 2 файла, в които са добавени 3 реда и са изтрити 27 реда
  1. 0 7
      src/app/app.component.html
  2. 3 20
      src/app/bc-info/bc-info.service.ts

+ 0 - 7
src/app/app.component.html

@@ -3,11 +3,4 @@
   <div class="hs-map">
     <hslayers></hslayers>
   </div>
-  <div class="blockchain-info">
-    <blockchain-info></blockchain-info>
-  </div>
 </div>
-<div class="pl-2">
-  <h3>About</h3>
-  <p>blah blah blah</p>
-</div>

+ 3 - 20
src/app/bc-info/bc-info.service.ts

@@ -8,9 +8,6 @@ import { queries, commands } from 'iroha-helpers'
 import { AppConfigService, BcConfig } from '../app.config.service';
 import { Buffer } from 'buffer';
 
-
-
-
 @Injectable({ providedIn: 'root' })
 export class BcInfoService {  
   private readonly commandService: CommandService;
@@ -20,7 +17,7 @@ export class BcInfoService {
   private readonly _bcConfig: BcConfig;
 
   user = 'kunickyd@test';
-  // userPrivateKey = 'ecb7f22887b0b45d1923fcd147d34bb6fd79f56eb54ed5af42c9d70c7808a9d8';
+  userPrivateKey = '5ee90333f04f42f457f2d10f1cbd7ec870b041184074dce2b744aa17e67b1e9a';
   userBalance = -1;
   price = -1;
   paymentHash = "";
@@ -38,25 +35,11 @@ export class BcInfoService {
     this.commandService = new CommandService(this._bcConfig.IROHA_ADDRESS);
     this.queryService = new QueryService(this._bcConfig.IROHA_ADDRESS);
 
-
-    this.getUserBalance();
-    this.getPrice(this.extent).then(price => this.price = price);
-
     this.basicAuthHeaders = new HttpHeaders();
-
-    this.basicAuthHeaders.append("Authorization", "Basic " + Buffer.from("admin:password", 'base64'));
-  }
-
-  async getUserBalance(): Promise<any> {    
-    this.userBalance = await this.getUserBalanceFromIroha(this.user, "ecb7f22887b0b45d1923fcd147d34bb6fd79f56eb54ed5af42c9d70c7808a9d8", this._bcConfig.ASSET);
-  }
-
-  async pay(): Promise<any> {    
-    this.paymentHash = await this.transferAssets(this.user, "ecb7f22887b0b45d1923fcd147d34bb6fd79f56eb54ed5af42c9d70c7808a9d8", this._bcConfig.ASSET, JSON.stringify({ extent: this.extent }), this.price);
-    this.dataUrl = await this.requestData(this.paymentHash, this.user);
+    this.basicAuthHeaders = this.basicAuthHeaders.append("Authorization", "Basic " + Buffer.from("admin:superPasswd").toString("base64"));
   }
 
-  async getUserBalanceFromIroha(user: string, userPrivateKey: string, assetId: string): Promise<number> {
+  async getUserBalance(user: string, userPrivateKey: string, assetId: string): Promise<number> {
 
     let queryOptions = {
       privateKey: userPrivateKey,