Skip to content

Commit

Permalink
Removes _syncSdkState, which wasn't actually doing anything.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-miller-0 committed Mar 19, 2022
1 parent e507be2 commit 9c909e9
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ class LatticeKeyring extends EventEmitter {
},
};
const res = await this.sdkSession.sign(req);
this._syncSdkState();
if (!res.sig) {
throw new Error("No signature returned");
}
Expand Down Expand Up @@ -591,10 +590,8 @@ class LatticeKeyring extends EventEmitter {
this.sdkSession.timeout = CONNECT_TIMEOUT;
await this.sdkSession.connect(this.creds.deviceID)
this.sdkSession.timeout = SDK_TIMEOUT;
this._syncSdkState();
} catch (err) {
this.sdkSession.timeout = SDK_TIMEOUT;
this._syncSdkState();
throw new Error(err);
}
}
Expand Down Expand Up @@ -652,7 +649,6 @@ class LatticeKeyring extends EventEmitter {
skipCache: true,
};
const addrs = await this.sdkSession.getAddresses(addrData);
this._syncSdkState();
// Sanity check -- if this returned 0 addresses, handle the error
if (addrs.length < 1) {
throw new Error('No addresses returned');
Expand All @@ -666,7 +662,6 @@ class LatticeKeyring extends EventEmitter {

async _signTxData(txData) {
const res = await this.sdkSession.sign({ currency: 'ETH', data: txData });
this._syncSdkState();
if (!res.tx) {
throw new Error('No transaction payload returned.');
}
Expand Down Expand Up @@ -754,13 +749,6 @@ class LatticeKeyring extends EventEmitter {
}
return activeWallet.uid.toString('hex');
}

_syncSdkState() {
if (!this.sdkSession) {
return;
}
this.sdkState = this.sdkSession.getStateData();
}
}

LatticeKeyring.type = keyringType
Expand Down

0 comments on commit 9c909e9

Please sign in to comment.