Skip to content

Commit

Permalink
fix some gas amount
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenwang1996 committed Aug 26, 2019
1 parent 4c06838 commit 2fd0625
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions test/account.access_key.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const BN = require('bn.js');
const nearlib = require('../lib/index');
const testUtils = require('./test-utils');
Expand All @@ -18,17 +17,20 @@ beforeAll(async () => {

beforeEach(async () => {
contractId = testUtils.generateUniqueString('test');
console.log('Contract id: ' + contractId);
workingAccount = await testUtils.createAccount(testAccount);
contract = await testUtils.deployContract(workingAccount, contractId);
});

test('make function call using access key', async() => {
const keyPair = nearlib.utils.KeyPair.fromRandom('ed25519');
await workingAccount.addKey(keyPair.getPublicKey(), contractId, '', 1000000);
console.log(workingAccount.accountId);
await workingAccount.addKey(keyPair.getPublicKey(), contractId, '', 10000000);

// Override in the key store the workingAccount key to the given access key.
await nearjs.connection.signer.keyStore.setKey(testUtils.networkId, workingAccount.accountId, keyPair);
const setCallValue = testUtils.generateUniqueString('setCallPrefix');
console.log('setCallValue: `{}`', setCallValue);
await contract.setValue({value: setCallValue});
expect(await contract.getValue()).toEqual(setCallValue);
});
Expand Down
2 changes: 1 addition & 1 deletion test/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function createAccount(masterAccount, options = { amount: INITIAL_BALANCE,
return new nearlib.Account(masterAccount.connection, newAccountName);
}

async function deployContract(workingAccount, contractId, options = { amount: new BN(100000) }) {
async function deployContract(workingAccount, contractId, options = { amount: new BN(10000000) }) {
const newPublicKey = await workingAccount.connection.signer.createKey(contractId, networkId);
const data = [...(await fs.readFile(HELLO_WASM_PATH))];
await workingAccount.createAndDeployContract(contractId, newPublicKey, data, options.amount);
Expand Down

0 comments on commit 2fd0625

Please sign in to comment.