mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
pow-testgiver support
This commit is contained in:
parent
dbde9c1c40
commit
f064b1047a
257 changed files with 6665 additions and 2608 deletions
|
@ -14,7 +14,7 @@
|
|||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright 2017-2019 Telegram Systems LLP
|
||||
Copyright 2017-2020 Telegram Systems LLP
|
||||
*/
|
||||
#include "td/db/utils/BlobView.h"
|
||||
|
||||
|
|
|
@ -14,10 +14,11 @@
|
|||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright 2017-2019 Telegram Systems LLP
|
||||
Copyright 2017-2020 Telegram Systems LLP
|
||||
*/
|
||||
#pragma once
|
||||
#include "td/utils/buffer.h"
|
||||
#include "td/utils/Status.h"
|
||||
|
||||
namespace td {
|
||||
class BlobViewImpl;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "td/utils/buffer.h"
|
||||
#include "td/utils/Slice.h"
|
||||
#include "td/utils/Span.h"
|
||||
#include "td/utils/Status.h"
|
||||
#include "td/utils/port/IoSlice.h"
|
||||
|
||||
namespace td {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
Copyright 2017-2020 Telegram Systems LLP
|
||||
*/
|
||||
#include "td/utils/OptionsParser.h"
|
||||
#include "td/utils/OptionParser.h"
|
||||
#include "td/utils/filesystem.h"
|
||||
#include "td/utils/port/FileFd.h"
|
||||
#include "td/utils/Timer.h"
|
||||
|
@ -598,12 +598,13 @@ int main(int argc, char **argv) {
|
|||
Mode mode = Baseline;
|
||||
size_t buffer_size = 1024;
|
||||
|
||||
td::OptionsParser options_parser;
|
||||
options_parser.add_option('f', td::Slice("from"), td::Slice("read from file"), [&](td::Slice arg) -> td::Status {
|
||||
from = arg.str();
|
||||
return td::Status::OK();
|
||||
});
|
||||
options_parser.add_option('m', td::Slice("mode"), td::Slice("mode"), [&](td::Slice arg) -> td::Status {
|
||||
td::OptionParser options_parser;
|
||||
options_parser.add_checked_option('f', td::Slice("from"), td::Slice("read from file"),
|
||||
[&](td::Slice arg) -> td::Status {
|
||||
from = arg.str();
|
||||
return td::Status::OK();
|
||||
});
|
||||
options_parser.add_checked_option('m', td::Slice("mode"), td::Slice("mode"), [&](td::Slice arg) -> td::Status {
|
||||
TRY_RESULT(x, td::to_integer_safe<int>(arg));
|
||||
switch (x) {
|
||||
case 0:
|
||||
|
@ -627,11 +628,12 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
return td::Status::Error("unknown mode");
|
||||
});
|
||||
options_parser.add_option('b', td::Slice("buffer"), td::Slice("buffer size"), [&](td::Slice arg) -> td::Status {
|
||||
TRY_RESULT(x, td::to_integer_safe<size_t>(arg));
|
||||
buffer_size = x;
|
||||
return td::Status::OK();
|
||||
});
|
||||
options_parser.add_checked_option('b', td::Slice("buffer"), td::Slice("buffer size"),
|
||||
[&](td::Slice arg) -> td::Status {
|
||||
TRY_RESULT(x, td::to_integer_safe<size_t>(arg));
|
||||
buffer_size = x;
|
||||
return td::Status::OK();
|
||||
});
|
||||
|
||||
auto status = options_parser.run(argc, argv);
|
||||
if (status.is_error()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue