Skip to content

Commit

Permalink
fix debug code, remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mattlockyer committed Oct 31, 2020
1 parent a521ff5 commit 20c2f06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 45 deletions.
22 changes: 1 addition & 21 deletions lib/account_multisig.js

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

25 changes: 1 addition & 24 deletions src/account_multisig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ export class AccountMultisig extends Account {

async deployMultisig(contractBytes: Uint8Array) {
const { accountId } = this

console.log(await this.state(), (await this.state()).code_hash)

const initialize = (await this.state()).code_hash === "11111111111111111111111111111111"
// replace account keys & recovery keys with limited access keys; DO NOT replace seed phrase keys
const accountKeys = (await this.getAccessKeys()).map((ak) => ak.public_key)
const seedOrLedgerKeys = (await this.getRecoveryMethods()).data
Expand All @@ -158,7 +154,7 @@ export class AccountMultisig extends Account {
addKey(confirmOnlyKey, functionCallAccessKey(accountId, MULTISIG_CONFIRM_METHODS, null)),
deployContract(contractBytes),
]
if (initialize) {
if ((await this.state()).code_hash === '11111111111111111111111111111111') {
actions.push(functionCall('new', newArgs, MULTISIG_GAS, MULTISIG_DEPOSIT),)
}
console.log('deploying multisig contract for', accountId)
Expand Down Expand Up @@ -186,25 +182,6 @@ export class AccountMultisig extends Account {
return await this.signAndSendTransaction(accountId, actions)
}

// async enable(contractBytes: Uint8Array) {
// const { accountId } = this
// const accountKeys = (await this.getAccessKeys()).map((ak) => ak.public_key)
// const seedPhraseKeys = (await this.getRecoveryMethods()).data
// .filter(({ kind, publicKey }) => kind === 'phrase' && publicKey !== null && accountKeys.includes(publicKey))
// .map((rm) => rm.publicKey)
// const confirmOnlyKey = (await this.postSignedJson('/2fa/getAccessKey', { accountId })).publicKey
// const fak2lak = accountKeys.filter((k) => !seedPhraseKeys.includes(k) && !confirmOnlyKey.includes(k))
// .map((k) => PublicKey.from(k))
// const actions = [
// addKey(PublicKey.from(confirmOnlyKey), functionCallAccessKey(accountId, MULTISIG_CONFIRM_METHODS, null)),
// ...fak2lak.map((k) => deleteKey(k)),
// ...fak2lak.map((k) => addKey(k, functionCallAccessKey(accountId, MULTISIG_CHANGE_METHODS, null))),
// deployContract(contractBytes),
// ]
// console.log('enabling 2fa for', accountId, actions)
// return await super.signAndSendTransaction(accountId, actions);
// }

async deleteUnconfirmedRequests () {
const { contract } = this
const request_ids = await this.getRequestIds()
Expand Down

0 comments on commit 20c2f06

Please sign in to comment.