Skip to content

Instantly share code, notes, and snippets.

View ValeryDubrava's full-sized avatar
🎯
Focusing

Valera Dubrava ValeryDubrava

🎯
Focusing
View GitHub Profile
[{"constant":true,"inputs":[],"name":"getVersion","outputs":[{"name":"","type":"bytes8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"invokeTop","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_count","type":"uint256"}],"name":"getTop","outputs":[{"name":"addresses","type":"address[]"},{"name":"timestamps","type":"uint256[]"},{"name":"gasLimits","type":"uint256[]"},{"name":"gasPrices","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"},{"name":"_timestamp","type":"uint256"},{"name":"_gasLimit","type":"uint256"},{"name":"_gasPrice","type":"uint256"}],"name":"register","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"getTop","outputs":[{"name":"contractAddress","type":"address"},{"na
[{"constant":true,"inputs":[],"name":"getVersion","outputs":[{"name":"","type":"bytes8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getTopOnce","outputs":[{"name":"contractAddress","type":"address"},{"name":"timestamp","type":"uint256"},{"name":"gasLimit","type":"uint256"},{"name":"gasPrice","type":"uint256"},{"name":"invokeGas","type":"uint256"},{"name":"rewardAmount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_count","type":"uint256"}],"name":"getTop","outputs":[{"name":"addresses","type":"address[]"},{"name":"timestamps","type":"uint256[]"},{"name":"gasLimits","type":"uint256[]"},{"name":"gasPrices","type":"uint256[]"},{"name":"invokeGases","type":"uint256[]"},{"name":"rewardAmounts","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"},{"name":"_timestamp","type":"uint256"},{"name":"_gasLim
[{"constant":true,"inputs":[],"name":"getVersion","outputs":[{"name":"","type":"bytes8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getTopOnce","outputs":[{"name":"contractAddress","type":"address"},{"name":"timestamp","type":"uint256"},{"name":"gasLimit","type":"uint256"},{"name":"gasPrice","type":"uint256"},{"name":"invokeGas","type":"uint256"},{"name":"rewardAmount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_count","type":"uint256"}],"name":"getTop","outputs":[{"name":"addresses","type":"address[]"},{"name":"timestamps","type":"uint256[]"},{"name":"gasLimits","type":"uint256[]"},{"name":"gasPrices","type":"uint256[]"},{"name":"invokeGases","type":"uint256[]"},{"name":"rewardAmounts","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"},{"name":"_timestamp","type":"uint256"},{"name":"_gasLim
[{"anonymous":false,"inputs":[{"indexed":true,"name":"_invoker","type":"address"},{"indexed":true,"name":"_address","type":"address"},{"indexed":false,"name":"_status","type":"bool"},{"indexed":false,"name":"_usedGas","type":"uint256"}],"name":"Invoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_registrant","type":"address"},{"indexed":true,"name":"_address","type":"address"},{"indexed":false,"name":"_timestamp","type":"uint256"},{"indexed":false,"name":"_gasLimit","type":"uint256"},{"indexed":false,"name":"_gasPrice","type":"uint256"}],"name":"Registered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_registrant","type":"address"},{"indexed":true,"name":"_address","type":"address"},{"indexed":false,"name":"_timestamp","type":"uint256"},{"indexed":false,"name":"_gasLimit","type":"uint256"},{"indexed":false,"name":"_gasPrice","type":"uint256"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"Unregistered","type":"event"},{"constant":false,"inputs":[
[{"anonymous":false,"inputs":[{"indexed":true,"name":"_invoker","type":"address"},{"indexed":true,"name":"_address","type":"address"},{"indexed":false,"name":"_status","type":"bool"},{"indexed":false,"name":"_usedGas","type":"uint256"}],"name":"Invoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_registrant","type":"address"},{"indexed":true,"name":"_address","type":"address"},{"indexed":false,"name":"_timestamp","type":"uint256"},{"indexed":false,"name":"_gasLimit","type":"uint256"},{"indexed":false,"name":"_gasPrice","type":"uint256"}],"name":"Registered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_registrant","type":"address"},{"indexed":true,"name":"_address","type":"address"},{"indexed":false,"name":"_timestamp","type":"uint256"},{"indexed":false,"name":"_gasLimit","type":"uint256"},{"indexed":false,"name":"_gasPrice","type":"uint256"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"Unregistered","type":"event"},{"constant":false,"inputs":[
const joule = await createJoule();
const contract100k = await Contract100kGas.new();
const price = await joule.getPrice(gasLimit1, gasPrice1);
await joule.register(contract100k.address, nowPlus3minutes, gasLimit1, gasPrice1, {value: price});
await joule.unregister(0, contract100k.address, nowPlus3minutes, gasLimit1, gasPrice1);
let count = await joule.getCount();
count.should.be.bignumber.equals(1, "contract must be registered");
it('#24 invoke with gas to invoke returned by top', async () => {
const joule = await createJoule();
const contract100k = await Contract100kGas.new();
const contract300k = await Contract300kGas.new();
const price = await joule.getPrice(gasLimit1, gasPrice1);
await joule.register(contract100k.address, nowPlus3minutes, gasLimit1, gasPrice1, {value: price});
// await joule.unregister(0, contract100k.address, nowPlus3minutes, gasLimit1, gasPrice1);
let count = await joule.getCount();
[valery@dev bitcoin-0.16.0]$ ./configure --without-gui LIBS=-Wl,-rpath --prefix=/home/valery/bitcoin
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
epel/x86_64/metalink | 29 kB 00:00:00
extras | 3.4 kB 00:00:00
nodesource | 2.5 kB 00:00:00
updates | 3.4 kB 00:
enode://20c9ad97c081d63397d7b685a412227a40e23c8bdc6688c6f37e97cfbc22d2b4d1db1510d8f61e6a8866ad7f0e17c02b14182d37ea7c3c8b9c2683aeb6b733a1@52.169.14.227:30303
enode://6ce05930c72abc632c58e2e4324f7c7ea478cec0ed4fa2528982cf34483094e9cbc9216e7aa349691242576d552a2a56aaeae426c5303ded677ce455ba1acd9d@13.84.180.240:30303
enode://12d52c3796700fb5acff2c7d96df7bbb6d7109b67f3442ee3d99ac1c197016cddb4c3568bbeba05d39145c59c990cd64f76bc9b00d4b13f10095c49507dd4cf9@51.15.63.110:30303
enode://30d873bd09e089328e86b28776314c678abc70577a901f824f0ff1a0edc65f3f91ea15f193c2a60d93d44207df7c54645a61ab934db0c29858519581d3ed0f3c@51.15.82.108:30303
enode://482484b9198530ee2e00db89791823244ca41dcd372242e2e1297dd06f6d8dd357603960c5ad9cc8dc15fcdf0e4edd06b7ad7db590e67a0b54f798c26581ebd7@51.15.75.138:30303
enode://4f3ed57dc81fc127f398a85cb7e098242f7d53c52de77b2b04ac24918fa988ff3a7e5a7b2f67ef70f8f228189fb20521c602e98e26c1291242cb84047742406b@192.99.58.206:30304
enode://584c0db89b00719e9e7b1b5c32a4a8942f379f4d5d66bb69f9c7fa97fa42f64974e7b057b35eb