Skip to content
Snippets Groups Projects
Commit 958fc686 authored by Éloïs's avatar Éloïs
Browse files

[tests] blocks-tests-tools: add g1 chunks

parent 9a29f583
No related branches found
No related tags found
1 merge request!233Resolve "Fail to revert block with transactions with UTXO inputs"
This diff is collapsed.
// Copyright (C) 2019 Éloïs SANCHEZ
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! G1 blocks
use dubp_block_doc::BlockDocument;
/// Give g1 chunks (packages of 250 blocks)
pub fn get_g1_chunk(chunk_number: usize) -> Vec<BlockDocument> {
let mut gt_json_chunks_path = std::env::current_exe().expect("Fail to get current exe path.");
gt_json_chunks_path.pop();
gt_json_chunks_path.pop();
gt_json_chunks_path.pop();
gt_json_chunks_path.pop();
gt_json_chunks_path.push("lib");
gt_json_chunks_path.push("tests-tools");
gt_json_chunks_path.push("blocks-tests-tools");
gt_json_chunks_path.push("rsc");
gt_json_chunks_path.push("g1-chunks");
crate::json_chunk_parser::open_and_parse_one_json_chunk(&gt_json_chunks_path, chunk_number).1
}
...@@ -28,5 +28,6 @@ pub fn get_gt_chunk(chunk_number: usize) -> Vec<BlockDocument> { ...@@ -28,5 +28,6 @@ pub fn get_gt_chunk(chunk_number: usize) -> Vec<BlockDocument> {
gt_json_chunks_path.push("tests-tools"); gt_json_chunks_path.push("tests-tools");
gt_json_chunks_path.push("blocks-tests-tools"); gt_json_chunks_path.push("blocks-tests-tools");
gt_json_chunks_path.push("rsc"); gt_json_chunks_path.push("rsc");
gt_json_chunks_path.push("gt-chunks");
crate::json_chunk_parser::open_and_parse_one_json_chunk(&gt_json_chunks_path, chunk_number).1 crate::json_chunk_parser::open_and_parse_one_json_chunk(&gt_json_chunks_path, chunk_number).1
} }
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
unused_import_braces unused_import_braces
)] )]
pub mod g1;
pub mod gt; pub mod gt;
pub mod json_chunk_parser; pub mod json_chunk_parser;
pub mod mocks; pub mod mocks;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment