Disable DeSo's approve component. TODOs to put in our own txn signing stuff

This commit is contained in:
Daniel Krol 2022-05-04 15:23:14 -04:00
parent 5c8d42b2b1
commit 6b6efe6ce0

View file

@ -1,6 +1,5 @@
import { Component, OnInit } from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {CryptoService} from '../crypto.service';
import {IdentityService} from '../identity.service'; import {IdentityService} from '../identity.service';
import {AccountService} from '../account.service'; import {AccountService} from '../account.service';
import {GlobalVarsService} from '../global-vars.service'; import {GlobalVarsService} from '../global-vars.service';
@ -33,7 +32,6 @@ import {
TransactionMetadataDAOCoin, TransactionMetadataDAOCoin,
TransactionMetadataTransferDAOCoin TransactionMetadataTransferDAOCoin
} from '../../lib/deso/transaction'; } from '../../lib/deso/transaction';
import bs58check from 'bs58check';
@Component({ @Component({
selector: 'app-approve', selector: 'app-approve',
@ -50,7 +48,6 @@ export class ApproveComponent implements OnInit {
constructor( constructor(
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private cryptoService: CryptoService,
private identityService: IdentityService, private identityService: IdentityService,
private accountService: AccountService, private accountService: AccountService,
public globalVars: GlobalVarsService, public globalVars: GlobalVarsService,
@ -78,7 +75,10 @@ export class ApproveComponent implements OnInit {
} }
onSubmit(): void { onSubmit(): void {
const signedTransactionHex = this.signingService.signTransaction(this.seedHex(), this.transactionHex); // TODO
throw "replace all of this transaction parsing and checking with bitcoinjs-lib."
const seedHex = ""
const signedTransactionHex = this.signingService.signTransaction(seedHex, this.transactionHex);
this.finishFlow(signedTransactionHex); this.finishFlow(signedTransactionHex);
} }
@ -89,11 +89,6 @@ export class ApproveComponent implements OnInit {
}); });
} }
seedHex(): string {
const encryptedSeedHex = this.accountService.getEncryptedUsers()[this.publicKey].encryptedSeedHex;
return this.cryptoService.decryptSeedHex(encryptedSeedHex, this.globalVars.hostname);
}
generateTransactionDescription(): void { generateTransactionDescription(): void {
let description = 'sign an unknown transaction'; let description = 'sign an unknown transaction';
let publicKeys: string[] = []; let publicKeys: string[] = [];
@ -253,8 +248,11 @@ export class ApproveComponent implements OnInit {
} }
base58KeyCheck(keyBytes: Uint8Array): string { base58KeyCheck(keyBytes: Uint8Array): string {
const prefix = CryptoService.PUBLIC_KEY_PREFIXES[this.globalVars.network].deso; // TODO
return bs58check.encode(Buffer.from([...prefix, ...keyBytes])); throw "replace all of this transaction parsing and checking with bitcoinjs-lib."
return ""
// const prefix = CryptoService.PUBLIC_KEY_PREFIXES[this.globalVars.network as Network].deso;
// return bs58check.encode(Buffer.from([...prefix, ...keyBytes]));
} }
hexNanosToUnitString(nanos: Buffer): string { hexNanosToUnitString(nanos: Buffer): string {