Skip to content

Commit

Permalink
Removing logging noise, removed double setting of keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
thekevinbrown committed Apr 10, 2019
1 parent 874dc27 commit 683a439
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 45 deletions.
10 changes: 2 additions & 8 deletions src/accounts/accountManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ export class AccountManager {

await AccountManager.setupAccount(account, options);

if (EOSManager.signatureProvider) {
EOSManager.signatureProvider.keys.set(publicKey, privateKey);
}

accounts.push(account);
}

Expand All @@ -51,8 +47,6 @@ export class AccountManager {
EOSManager.signatureProvider.availableKeys.push(nonLegacyPublicKey);
}

console.log('Signature provider', EOSManager.signatureProvider);

const systemContract = await eos.getContract('eosio');

const actions: any = [
Expand Down Expand Up @@ -90,8 +84,8 @@ export class AccountManager {
];

// Note: You can deploy the system without system contracts. In this scenario,
// newaccount alone is enough. If there is a system contract with that action,
// then we definitely need to do it though.
// newaccount alone is enough. If there is a system contract with the buyrambytes action,
// then we definitely need to do it, but if there isn't, then trying to call it is an error.
if (systemContract.actions.has('buyrambytes')) {
actions.push({
account: 'eosio',
Expand Down
42 changes: 5 additions & 37 deletions src/contracts/contractDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export class ContractDeployer {
account: Account,
contractIdentifier: string
) {
console.log('Available keys', await EOSManager.signatureProvider.getAvailableKeys());

const buffer = new Serialize.SerialBuffer({
textEncoder: EOSManager.api.textEncoder,
textDecoder: EOSManager.api.textDecoder,
Expand All @@ -40,52 +38,22 @@ export class ContractDeployer {
);
abiDefinition.serialize(buffer, abi);

const requiredKeys = await EOSManager.rpc.getRequiredKeys({
transaction: {
actions: [
{
account: `eosio`,
name: `setcode`,
authorization: account.active,
data: {
account: account.name,
vmtype: 0,
vmversion: 0,
code: wasm.toString(`hex`),
},
},
{
account: `eosio`,
name: `setabi`,
authorization: account.active,
data: {
account: account.name,
abi: Buffer.from(buffer.asUint8Array()).toString(`hex`),
},
},
],
},
availableKeys: await EOSManager.signatureProvider.getAvailableKeys(),
});

console.log('Required keys', requiredKeys);

await EOSManager.transact({
actions: [
{
account: `eosio`,
name: `setcode`,
account: 'eosio',
name: 'setcode',
authorization: account.active,
data: {
account: account.name,
vmtype: 0,
vmversion: 0,
code: wasm.toString(`hex`),
code: wasm.toString('hex'),
},
},
{
account: `eosio`,
name: `setabi`,
account: 'eosio',
name: 'setabi',
authorization: account.active,
data: {
account: account.name,
Expand Down

0 comments on commit 683a439

Please sign in to comment.