Skip to content

Commit

Permalink
Merge pull request #128 from tonlabs/0.24.0-rc
Browse files Browse the repository at this point in the history
Version 0.24.0
  • Loading branch information
diserere authored Jun 17, 2020
2 parents f0b6a79 + e6532f1 commit 6e5e317
Show file tree
Hide file tree
Showing 12 changed files with 1,824 additions and 1,261 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Release Notes
All notable changes to this project will be documented in this file.

## 0.24.0 - Jun 3, 2020
### New
- Detailed errors produced by core library.
- Optional parameter `fullRun` for `runLocal` method allows to emulate an execution on a real node with all required checks and fees calculations.
- Optional parameter `account` for `runLocal` method allows to provide the specified account data instead of loading them from a blockchain.
- Optional result field `account` for `runLocal` and `runMessageLocal` methods returns state of an account after contract execution has finished. Presented only when the `fullRun` parameter has specified.
- Method `runMessageLocal` as a replacement for the `processRunMessageLocal` with `fullRun` and `account` parameters.
- `1003` error on contract run is replaced with more specific `1010`-`1012` errors

## 0.23.2 - May 25, 2020
### New
- Detailed errors instead of 1006.
Expand Down
41 changes: 28 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ pipeline {
echo "Job: ${JOB_NAME}"
script {
def params = [
// [
// $class: 'StringParameterValue',
// name: 'dockerimage_compilers',
// value: "tonlabs/compilers:latest"
// ],
// [
// $class: 'StringParameterValue',
// name: 'dockerimage_local_node',
// value: "tonlabs/local-node:latest"
// ],
[
$class: 'BooleanParameterValue',
name: 'RUN_TESTS_ALL',
value: false
],
[
$class: 'BooleanParameterValue',
name: 'RUN_TESTS_TON_CLIENT_JS',
value: true
],
[
$class: 'StringParameterValue',
name: 'ton_client_js_branch',
Expand All @@ -51,12 +51,27 @@ pipeline {
],
[
$class: 'BooleanParameterValue',
name: 'RUN_TESTS_ALL',
value: false
name: 'RUN_TESTS_TON_CLIENT_NODE_JS',
value: true
],
[
$class: 'StringParameterValue',
name: 'ton_client_node_js_branch',
value: "${GIT_BRANCH}" ==~ /\d+\.\d+\.\d+-rc/ ? "${GIT_BRANCH}" : "master"
],
[
$class: 'BooleanParameterValue',
name: 'RUN_TESTS_TON_CLIENT_JS',
name: 'RUN_TESTS_TON_CLIENT_WEB_JS',
value: true
],
[
$class: 'StringParameterValue',
name: 'ton_client_web_js_branch',
value: "${GIT_BRANCH}" ==~ /\d+\.\d+\.\d+-rc/ ? "${GIT_BRANCH}" : "master"
],
[
$class: 'BooleanParameterValue',
name: 'CHANGE_JS_DEPS',
value: true
],
]
Expand Down
184 changes: 2 additions & 182 deletions __tests__/aggregations.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test('Aggregations', async () => {
await testCollection(queries.messages, 1);
await testCollection(queries.blocks_signatures, 0);
});
const testCollection = async (c, field) => {
const testAggregateFunctions = async (c, field) => {
const tr = (await c.aggregate({
filter: {},
fields: [
Expand Down Expand Up @@ -55,192 +55,12 @@ const testCollection = async (c, field) => {
.toBeDefined();
expect(Number(tr[3]))
.toBeDefined();
console.log(`${field}: MIN ${Number(tr[0])} MAX ${Number(tr[1])} SUM ${Number(tr[2])} AVERAGE ${Number(tr[3])}`);
};
test('Aggregations: Account numeric fields', async () => {
const queries = tests.client.queries;
await testCollection(queries.accounts, 'workchain_id');
await testCollection(queries.accounts, 'last_paid');
await testCollection(queries.accounts, 'due_payment');
await testCollection(queries.accounts, 'last_trans_lt');
await testCollection(queries.accounts, 'balance');
await testCollection(queries.accounts, 'balance_other.currency');
await testCollection(queries.accounts, 'split_depth');
await testAggregateFunctions(queries.accounts, 'balance');
});

test('Aggregations: Block numeric fields', async () => {
const queries = tests.client.queries;
await testCollection(queries.blocks, 'global_id');
await testCollection(queries.blocks, 'seq_no');
await testCollection(queries.blocks, 'gen_utime');
await testCollection(queries.blocks, 'gen_catchain_seqno');
await testCollection(queries.blocks, 'flags');
await testCollection(queries.blocks, 'master_ref.end_lt');
await testCollection(queries.blocks, 'master_ref.seq_no');
await testCollection(queries.blocks, 'prev_ref.end_lt');
await testCollection(queries.blocks, 'prev_ref.seq_no');
await testCollection(queries.blocks, 'prev_alt_ref.end_lt');
await testCollection(queries.blocks, 'prev_alt_ref.seq_no');
await testCollection(queries.blocks, 'prev_vert_ref.end_lt');
await testCollection(queries.blocks, 'prev_vert_ref.seq_no');
await testCollection(queries.blocks, 'prev_vert_alt_ref.end_lt');
await testCollection(queries.blocks, 'prev_vert_alt_ref.seq_no');
await testCollection(queries.blocks, 'version');
await testCollection(queries.blocks, 'gen_validator_list_hash_short');
await testCollection(queries.blocks, 'vert_seq_no');
await testCollection(queries.blocks, 'start_lt');
await testCollection(queries.blocks, 'end_lt');
await testCollection(queries.blocks, 'workchain_id');
await testCollection(queries.blocks, 'min_ref_mc_seqno');
await testCollection(queries.blocks, 'prev_key_block_seqno');
await testCollection(queries.blocks, 'gen_software_version');
});

test('Aggregations: Block value_flow numeric fields', async () => {
const queries = tests.client.queries;
await testCollection(queries.blocks, 'value_flow.to_next_blk');
await testCollection(queries.blocks, 'value_flow.to_next_blk_other.currency');
await testCollection(queries.blocks, 'value_flow.to_next_blk_other.value');
await testCollection(queries.blocks, 'value_flow.exported');
await testCollection(queries.blocks, 'value_flow.exported_other.currency');
await testCollection(queries.blocks, 'value_flow.exported_other.value');
await testCollection(queries.blocks, 'value_flow.fees_collected');
await testCollection(queries.blocks, 'value_flow.fees_collected_other.currency');
await testCollection(queries.blocks, 'value_flow.fees_collected_other.value');
await testCollection(queries.blocks, 'value_flow.created');
await testCollection(queries.blocks, 'value_flow.created_other.currency');
await testCollection(queries.blocks, 'value_flow.created_other.value');
await testCollection(queries.blocks, 'value_flow.imported');
await testCollection(queries.blocks, 'value_flow.imported_other.currency');
await testCollection(queries.blocks, 'value_flow.imported_other.value');
await testCollection(queries.blocks, 'value_flow.from_prev_blk');
await testCollection(queries.blocks, 'value_flow.from_prev_blk_other.currency');
await testCollection(queries.blocks, 'value_flow.from_prev_blk_other.value');
await testCollection(queries.blocks, 'value_flow.minted');
await testCollection(queries.blocks, 'value_flow.minted_other.currency');
await testCollection(queries.blocks, 'value_flow.minted_other.value');
await testCollection(queries.blocks, 'value_flow.fees_imported');
await testCollection(queries.blocks, 'value_flow.fees_imported_other.currency');
await testCollection(queries.blocks, 'value_flow.fees_imported_other.value');
});

test('Aggregations: Block in_msg_descr numeric fields', async () => {
const queries = tests.client.queries;
await testCollection(queries.blocks, 'in_msg_descr.ihr_fee');
await testCollection(queries.blocks, 'in_msg_descr.in_msg.fwd_fee_remaining');
await testCollection(queries.blocks, 'in_msg_descr.fwd_fee');
await testCollection(queries.blocks, 'in_msg_descr.out_msg.fwd_fee_remaining');
await testCollection(queries.blocks, 'in_msg_descr.transit_fee');
await testCollection(queries.blocks, 'out_msg_descr.out_msg.fwd_fee_remaining');
await testCollection(queries.blocks, 'out_msg_descr.reimport.ihr_fee');
await testCollection(queries.blocks, 'out_msg_descr.reimport.in_msg.fwd_fee_remaining');
await testCollection(queries.blocks, 'out_msg_descr.reimport.fwd_fee');
await testCollection(queries.blocks, 'out_msg_descr.reimport.out_msg.fwd_fee_remaining');
await testCollection(queries.blocks, 'out_msg_descr.reimport.transit_fee');
await testCollection(queries.blocks, 'out_msg_descr.imported.ihr_fee');
await testCollection(queries.blocks, 'out_msg_descr.imported.in_msg.fwd_fee_remaining');
await testCollection(queries.blocks, 'out_msg_descr.imported.fwd_fee');
await testCollection(queries.blocks, 'out_msg_descr.imported.out_msg.fwd_fee_remaining');
await testCollection(queries.blocks, 'out_msg_descr.imported.transit_fee');
await testCollection(queries.blocks, 'out_msg_descr.import_block_lt');
await testCollection(queries.blocks, 'out_msg_descr.next_workchain');
await testCollection(queries.blocks, 'out_msg_descr.next_addr_pfx');
});

test('Aggregations: Block account_blocks & state_update numeric fields', async () => {
const queries = tests.client.queries;
await testCollection(queries.blocks, 'account_blocks.transactions.lt');
await testCollection(queries.blocks, 'account_blocks.transactions.total_fees');
await testCollection(queries.blocks, 'account_blocks.transactions.total_fees_other.currency');
await testCollection(queries.blocks, 'account_blocks.transactions.total_fees_other.value');
await testCollection(queries.blocks, 'account_blocks.tr_count');

await testCollection(queries.blocks, 'state_update.new_depth');
await testCollection(queries.blocks, 'state_update.old_depth');
});

test('Aggregations: Block master numeric fields', async () => {
const queries = tests.client.queries;
await testCollection(queries.blocks, 'master.min_shard_gen_utime');
await testCollection(queries.blocks, 'master.max_shard_gen_utime');
await testCollection(queries.blocks, 'master.shard_hashes.workchain_id');
await testCollection(queries.blocks, 'master.shard_hashes.descr.seq_no');
await testCollection(queries.blocks, 'master.shard_hashes.descr.start_lt');

await testCollection(queries.blocks, 'master.shard_hashes.descr.end_lt');
await testCollection(queries.blocks, 'master.shard_hashes.descr.flags');
await testCollection(queries.blocks, 'master.shard_hashes.descr.next_catchain_seqno');
await testCollection(queries.blocks, 'master.shard_hashes.descr.min_ref_mc_seqno');
await testCollection(queries.blocks, 'master.shard_hashes.descr.gen_utime');
await testCollection(queries.blocks, 'master.shard_hashes.descr.split');
await testCollection(queries.blocks, 'master.shard_hashes.descr.fees_collected');
await testCollection(queries.blocks, 'master.shard_hashes.descr.fees_collected_other.currency');
await testCollection(queries.blocks, 'master.shard_hashes.descr.fees_collected_other.value');
await testCollection(queries.blocks, 'master.shard_hashes.descr.funds_created');
await testCollection(queries.blocks, 'master.shard_hashes.descr.funds_created_other.currency');
await testCollection(queries.blocks, 'master.shard_hashes.descr.funds_created_other.value');

await testCollection(queries.blocks, 'master.shard_fees.workchain_id');
await testCollection(queries.blocks, 'master.shard_fees.fees');
await testCollection(queries.blocks, 'master.shard_fees.fees_other.currency');
await testCollection(queries.blocks, 'master.shard_fees.fees_other.value');
await testCollection(queries.blocks, 'master.recover_create_msg.ihr_fee');
await testCollection(queries.blocks, 'master.recover_create_msg.in_msg.fwd_fee_remaining');
await testCollection(queries.blocks, 'master.recover_create_msg.fwd_fee');
await testCollection(queries.blocks, 'master.recover_create_msg.out_msg.fwd_fee_remaining');
await testCollection(queries.blocks, 'master.recover_create_msg.transit_fee');


await testCollection(queries.blocks, 'master.config.p7.currency');
await testCollection(queries.blocks, 'master.config.p8.version');
await testCollection(queries.blocks, 'master.config.p9');
await testCollection(queries.blocks, 'master.config.p10');
});

test('Aggregations: Blocks_signatures numeric fields', async () => {
const queries = tests.client.queries;
await testCollection(queries.blocks_signatures, 'gen_utime');
await testCollection(queries.blocks_signatures, 'seq_no');
await testCollection(queries.blocks_signatures, 'workchain_id');
await testCollection(queries.blocks_signatures, 'validator_list_hash_short');
await testCollection(queries.blocks_signatures, 'catchain_seqno');
await testCollection(queries.blocks_signatures, 'sig_weight');
});

test('Aggregations: Messages numeric fields', async () => {
const queries = tests.client.queries;
await testCollection(queries.messages, 'split_depth');
await testCollection(queries.messages, 'src_workchain_id');
await testCollection(queries.messages, 'dst_workchain_id');
await testCollection(queries.messages, 'created_lt');
await testCollection(queries.messages, 'created_at');
await testCollection(queries.messages, 'ihr_fee');
await testCollection(queries.messages, 'fwd_fee');
await testCollection(queries.messages, 'import_fee');
await testCollection(queries.messages, 'value');
await testCollection(queries.messages, 'value_other.currency');
await testCollection(queries.messages, 'value_other.value');
});

test('Aggregations: Transactions numeric fields', async () => {
const queries = tests.client.queries;
await testCollection(queries.transactions, 'lt');
await testCollection(queries.transactions, 'prev_trans_lt');
await testCollection(queries.transactions, 'now');
await testCollection(queries.transactions, 'outmsg_cnt');
await testCollection(queries.transactions, 'storage.storage_fees_collected');
await testCollection(queries.transactions, 'storage.storage_fees_due');
await testCollection(queries.transactions, 'compute.gas_fees');
await testCollection(queries.transactions, 'compute.gas_used');
await testCollection(queries.transactions, 'compute.gas_limit');
await testCollection(queries.transactions, 'compute.gas_credit');
await testCollection(queries.transactions, 'compute.mode');
await testCollection(queries.transactions, 'compute.exit_code');
await testCollection(queries.transactions, 'compute.exit_arg');
await testCollection(queries.transactions, 'compute.vm_steps');
});


test('Validator set', async () => {
if (nodeSe) {
return;
Expand Down
Loading

0 comments on commit 6e5e317

Please sign in to comment.