Comparing version 7.1.4 to 7.1.5
@@ -15,7 +15,7 @@ # Exchange Contract | ||
# setup the cli wallet command | ||
alias cleos='docker-compose exec walletd /opt/eosio/bin/cleos -H nodeos' | ||
alias cleos='docker-compose exec walletd /opt/eosio/bin/cleos -H nodeosd' | ||
``` | ||
In any case, a similar setup as followed may be used. Please make sure you have unlocked wallet and have the test key imported | ||
- We need wallet_api_plugin in your eos node (nodeos), ensure your config.ini has `eosio::wallet_api_plugin` before starting the eos node | ||
- We need wallet_api_plugin in your eos node (nodeosd), ensure your config.ini has `eosio::wallet_api_plugin` before starting the eos node | ||
- If you have never create a wallet before, create one first | ||
@@ -22,0 +22,0 @@ ``` |
{ | ||
"initial_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", | ||
"initial_timestamp": "2017-03-30T12:00:00", | ||
"initial_parameters": { | ||
"maintenance_interval": 86400, | ||
"maintenance_skip_slots": 3, | ||
"maximum_transaction_size": 2048, | ||
"maximum_block_size": 2048000000, | ||
"maximum_time_until_expiration": 86400, | ||
"maximum_producer_count": 1001 | ||
}, | ||
"immutable_parameters": { | ||
"min_producer_count": 21 | ||
}, | ||
"initial_chain_id": "0000000000000000000000000000000000000000000000000000000000000000" | ||
"initial_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", | ||
"initial_timestamp": "2017-03-30T12:00:00", | ||
"initial_parameters": { | ||
"maintenance_interval": 86400, | ||
"maintenance_skip_slots": 3, | ||
"maximum_transaction_size": 2048, | ||
"maximum_block_size": 2048000000, | ||
"maximum_time_until_expiration": 86400, | ||
"maximum_producer_count": 1001 | ||
}, | ||
"immutable_parameters": { | ||
"min_producer_count": 21 | ||
}, | ||
"initial_chain_id": "0000000000000000000000000000000000000000000000000000000000000000" | ||
} |
@@ -264,5 +264,5 @@ 'use strict'; | ||
// eos is a bad test case, but it was the only native contract | ||
var name = 'eosio'; | ||
var name = 'currency'; | ||
return Eos.Localnet({ signProvider: signProvider }).contract(name).then(function (contract) { | ||
contract.transfer('inita', 'initb', '1 EOS', '') | ||
return contract.transfer('inita', 'initb', '1 CUR', '') | ||
// transaction sent on each command | ||
@@ -272,3 +272,3 @@ .then(function (tr) { | ||
return contract.transfer('initb', 'inita', '1 EOS', '').then(function (tr) { | ||
return contract.transfer('initb', 'inita', '1 CUR', '').then(function (tr) { | ||
assert.equal(1, tr.transaction.data.actions.length); | ||
@@ -282,25 +282,58 @@ }); | ||
it('action to contract atomic', function () { | ||
var amt = 1; // for unique transactions | ||
var testnet = Eos.Localnet({ signProvider: signProvider }); | ||
it('action to contract atomic', function _callee2() { | ||
var amt, testnet, trTest, assertTr; | ||
return regeneratorRuntime.async(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
amt = 1; // for unique transactions | ||
var trTest = function trTest(eos) { | ||
assert(eos.transfer('inita', 'initb', amt + ' EOS', '') == null); | ||
assert(eos.transfer('initb', 'inita', amt++ + ' EOS', '') == null); | ||
}; | ||
testnet = Eos.Localnet({ signProvider: signProvider }); | ||
var assertTr = function assertTr(test) { | ||
return test.then(function (tr) { | ||
assert.equal(2, tr.transaction.data.actions.length); | ||
}); | ||
}; | ||
trTest = function trTest(currency) { | ||
assert(currency.transfer('inita', 'initb', amt + ' CUR', '') == null); | ||
assert(currency.transfer('initb', 'inita', amt++ + ' CUR', '') == null); | ||
}; | ||
// contracts can be a string or array | ||
assertTr(testnet.transaction(['eosio'], function (_ref5) { | ||
var eosio = _ref5.eosio; | ||
return trTest(eosio); | ||
})); | ||
assertTr(testnet.transaction('eosio', function (eosio) { | ||
return trTest(eosio); | ||
})); | ||
assertTr = function assertTr(tr) { | ||
assert.equal(2, tr.transaction.data.actions.length); | ||
}; | ||
// contracts can be a string or array | ||
_context2.t0 = regeneratorRuntime; | ||
_context2.t1 = assertTr; | ||
_context2.next = 8; | ||
return regeneratorRuntime.awrap(testnet.transaction(['currency'], function (_ref5) { | ||
var currency = _ref5.currency; | ||
return trTest(currency); | ||
})); | ||
case 8: | ||
_context2.t2 = _context2.sent; | ||
_context2.t3 = (0, _context2.t1)(_context2.t2); | ||
_context2.next = 12; | ||
return _context2.t0.awrap.call(_context2.t0, _context2.t3); | ||
case 12: | ||
_context2.t4 = regeneratorRuntime; | ||
_context2.t5 = assertTr; | ||
_context2.next = 16; | ||
return regeneratorRuntime.awrap(testnet.transaction('currency', function (currency) { | ||
return trTest(currency); | ||
})); | ||
case 16: | ||
_context2.t6 = _context2.sent; | ||
_context2.t7 = (0, _context2.t5)(_context2.t6); | ||
_context2.next = 20; | ||
return _context2.t4.awrap.call(_context2.t4, _context2.t7); | ||
case 20: | ||
case 'end': | ||
return _context2.stop(); | ||
} | ||
} | ||
}, null, this); | ||
}); | ||
@@ -311,8 +344,8 @@ | ||
var tn = Eos.Localnet({ signProvider: signProvider }); | ||
return tn.contract('eosio').then(function (eosio) { | ||
return eosio.transaction(function (tr) { | ||
tr.transfer('inita', 'initb', '1 EOS', ''); | ||
tr.transfer('inita', 'initc', '2 EOS', ''); | ||
return tn.contract('currency').then(function (currency) { | ||
return currency.transaction(function (tr) { | ||
tr.transfer('inita', 'initb', '1 CUR', ''); | ||
tr.transfer('inita', 'initc', '2 CUR', ''); | ||
}).then(function () { | ||
return eosio.transfer('inita', 'initb', '3 EOS', ''); | ||
return currency.transfer('inita', 'initb', '3 CUR', ''); | ||
}); | ||
@@ -387,43 +420,39 @@ }); | ||
// ./eosioc set contract currency build/contracts/currency/currency.wast build/contracts/currency/currency.abi | ||
if (process.env['CURRENCY_ABI'] != null) { | ||
it('Transaction ABI lookup', function _callee2() { | ||
var eos, tx; | ||
return regeneratorRuntime.async(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
eos = Eos.Localnet(); | ||
_context2.next = 3; | ||
return regeneratorRuntime.awrap(eos.transaction({ | ||
actions: [{ | ||
account: 'currency', | ||
name: 'transfer', | ||
data: { | ||
from: 'inita', | ||
to: 'initb', | ||
quantity: '13 CUR', | ||
memo: '' | ||
}, | ||
authorization: [{ | ||
actor: 'inita', | ||
permission: 'active' | ||
}] | ||
it('Transaction ABI lookup', function _callee3() { | ||
var eos, tx; | ||
return regeneratorRuntime.async(function _callee3$(_context3) { | ||
while (1) { | ||
switch (_context3.prev = _context3.next) { | ||
case 0: | ||
eos = Eos.Localnet(); | ||
_context3.next = 3; | ||
return regeneratorRuntime.awrap(eos.transaction({ | ||
actions: [{ | ||
account: 'currency', | ||
name: 'transfer', | ||
data: { | ||
from: 'inita', | ||
to: 'initb', | ||
quantity: '13 CUR', | ||
memo: '' | ||
}, | ||
authorization: [{ | ||
actor: 'inita', | ||
permission: 'active' | ||
}] | ||
}, { sign: false, broadcast: false })); | ||
}] | ||
}, { sign: false, broadcast: false })); | ||
case 3: | ||
tx = _context2.sent; | ||
case 3: | ||
tx = _context3.sent; | ||
assert.equal(tx.transaction.data.actions[0].account, 'currency'); | ||
assert.equal(tx.transaction.data.actions[0].account, 'currency'); | ||
case 5: | ||
case 'end': | ||
return _context2.stop(); | ||
} | ||
case 5: | ||
case 'end': | ||
return _context3.stop(); | ||
} | ||
}, null, this); | ||
}); | ||
} else { | ||
console.log('To run the currency Abi test: deploy the "currency" smart contract, set the CURRENCY_ABI environment variable.'); | ||
} | ||
} | ||
}, null, this); | ||
}); | ||
} // if development | ||
@@ -430,0 +459,0 @@ |
@@ -87,3 +87,18 @@ 'use strict'; | ||
if (process.env['CURRENCY_ABI'] != null) { | ||
if (process.env['NODE_ENV'] === 'development') { | ||
describe('Eosio Abi', function () { | ||
it('Eosio contract parses', function (done) { | ||
var eos = Eos.Localnet(); | ||
eos.contract('eosio', function (error, eosio) { | ||
assert(!error, error); | ||
assert(eosio.transfer, 'eosio contract'); | ||
assert(eosio.issue, 'eosio contract'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
describe('Contract Abi', function () { | ||
@@ -121,4 +136,2 @@ it('Messages do not sort', function _callee() { | ||
}); | ||
} else { | ||
console.log('To run the currency Abi test: deploy the "currency" smart contract, set the CURRENCY_ABI environment variable.'); | ||
} | ||
@@ -125,0 +138,0 @@ |
@@ -208,3 +208,3 @@ 'use strict'; | ||
assert.equal(args.length, 1, 'transaction args: [contracts], transaction<callback|object>, [options], [callback]'); | ||
assert.equal(args.length, 1, 'transaction args: contracts<string|array>, transaction<callback|object>, [options], [callback]'); | ||
arg = args[0]; | ||
@@ -211,0 +211,0 @@ |
{ | ||
"name": "eosjs", | ||
"version": "7.1.4", | ||
"version": "7.1.5", | ||
"description": "General purpose library for the EOS blockchain.", | ||
@@ -50,3 +50,3 @@ "main": "lib/index.js", | ||
"eosjs-ecc": "^3.0.2", | ||
"eosjs-json": "^3.0.1", | ||
"eosjs-json": "^3.0.2", | ||
"fcbuffer": "^2.1.4" | ||
@@ -53,0 +53,0 @@ }, |
@@ -14,3 +14,3 @@ [](https://travis-ci.org/EOSIO/eosjs) | ||
| --- | --- | --- | --- | --- | --- | | ||
| dawn3 | branch: master | `npm install eosjs@dawn3` | branch: master | eosio/eos:20180322 | [local docker](https://github.com/EOSIO/eosjs/tree/master/docker) | | ||
| dawn3 | branch: master | `npm install eosjs@dawn3` | branch: master | eosio/eos:20180328 | [local docker](https://github.com/EOSIO/eosjs/tree/master/docker) | | ||
| dawn2 | branch: dawn2 | `npm install eosjs` | branch: dawn-2.x | eosio/eos:dawn2x | http or [https://t1readonly.eos.io](https://t1readonly.eos.io/v1/chain/get_info) | | ||
@@ -17,0 +17,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1289805
33599
2
Updatedeosjs-json@^3.0.2