Skip to content

Commit

Permalink
Be nice and add the signing key to the store if they pass it into add…
Browse files Browse the repository at this point in the history
…CodePermission.
  • Loading branch information
thekevinbrown committed Jun 28, 2019
1 parent c3c168c commit 60ad9ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/accounts/accountManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ export class AccountManager {
* @param account Account without `eosio.code` permissions
*/
public static addCodePermission = async (account: Account) => {
// Ensure we have the private key to do this if they've passed one in.
EOSManager.addSigningAccountIfMissing(account);

// We need to get their existing permissions, then add in a new eosio.code permission for this contract.
const { permissions } = await EOSManager.rpc.get_account(account.name);
const { required_auth } = permissions.find(
Expand Down

0 comments on commit 60ad9ee

Please sign in to comment.