Skip to content

Commit

Permalink
forger quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
klassare committed Dec 28, 2022
1 parent a2581c2 commit e9d3b1c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/services/operation/operation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { sign as naclSign } from 'tweetnacl';
import * as Bs58check from 'bs58check';
import * as bip39 from 'bip39';
import Big from 'big.js';
import { localForger } from '@taquito/local-forging';
import { localForger, LocalForger, ProtocolsHash } from '@taquito/local-forging';
import { CONSTANTS } from '../../../environments/environment';
import { ErrorHandlingPipe } from '../../pipes/error-handling.pipe';
import * as elliptic from 'elliptic';
Expand All @@ -26,6 +26,7 @@ export interface KeyPair {
@Injectable()
export class OperationService {
nodeURL = CONSTANTS.NODE_URL;
localTaquitoForger = new LocalForger('PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW' as ProtocolsHash);
prefix = {
tz1: new Uint8Array([6, 161, 159]),
tz2: new Uint8Array([6, 161, 161]),
Expand Down Expand Up @@ -420,7 +421,7 @@ export class OperationService {
console.log('Broadcast...');
const opbytes = sopbytes.slice(0, sopbytes.length - 128);
const edsig = this.sig2edsig(sopbytes.slice(sopbytes.length - 128));
return fromPromise(localForger.parse(opbytes))
return fromPromise(this.localTaquitoForger.parse(opbytes))
.pipe(
flatMap((fop: any) => {
fop.signature = edsig;
Expand Down Expand Up @@ -562,7 +563,7 @@ export class OperationService {
}
// Local forge with Taquito
localForge(operation: any): Observable<string> {
return fromPromise(localForger.forge(operation)).pipe(
return fromPromise(this.localTaquitoForger.forge(operation)).pipe(
flatMap((localForgedBytes: string) => {
return of(localForgedBytes);
})
Expand Down

0 comments on commit e9d3b1c

Please sign in to comment.