Skip to content

Commit

Permalink
fix deployMultisig to only convert full access keys to multisig limit…
Browse files Browse the repository at this point in the history
…ed access keys
  • Loading branch information
mattlockyer committed Nov 12, 2020
1 parent 59cd202 commit 6fefec0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 2 additions & 4 deletions lib/account_multisig.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/account_multisig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,16 @@ export class Account2FA extends AccountMultisig {
const seedOrLedgerKey = (await this.getRecoveryMethods()).data
.filter(({ kind, publicKey }) => (kind === 'phrase' || kind === 'ledger') && publicKey !== null)
.map((rm) => rm.publicKey)
console.log('seedOrLedgerKey', seedOrLedgerKey)

const fak2lak = (await this.getAccessKeys())
.filter(({ public_key, access_key: { permission } }) => permission === 'FullAccess' && !seedOrLedgerKey.includes(public_key))
.map((ak) => ak.public_key)
// .map(toPK)
console.log('fak2lak', fak2lak)
.map(toPK)


const confirmOnlyKey = toPK((await this.postSignedJson('/2fa/getAccessKey', { accountId })).publicKey)

const newArgs = Buffer.from(JSON.stringify({ 'num_confirmations': 2 }));

const actions = [
...fak2lak.map((pk) => deleteKey(pk)),
...fak2lak.map((pk) => addKey(pk, functionCallAccessKey(accountId, MULTISIG_CHANGE_METHODS, null))),
Expand Down

0 comments on commit 6fefec0

Please sign in to comment.