Skip to content

Commit 255a6c1

Browse files
committed
multisigs, deeplinks, fixed build for osx, updated examples etc
1 parent eb516af commit 255a6c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+803
-188
lines changed

.circleci/config.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ jobs:
3838
keys:
3939
- conan-dir-{{ checksum "conanfile.py" }}
4040
- run: conan install gtest/1.8.1@bincrafters/stable
41-
- run: conan install toolbox/3.1.0@edwardstock/latest
41+
- run: conan install toolbox/3.1.1@edwardstock/latest
4242
- run: conan install bip39/2.0.0@edwardstock/latest
43-
- run: conan install boost_multiprecision/1.69.0@bincrafters/stable
44-
- run: conan install boost_exception/1.69.0@bincrafters/stable
43+
- run: conan install boost/1.70.0@conan/stable
4544
- run:
4645
name: Configuring
4746
command: conan remove --locks && cd _build && cmake .. -DCMAKE_BUILD_TYPE=Debug -DMINTER_TX_TEST=ON

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Created by .ignore support plugin (hsz.mobi)
22
cmake-build-debug
33
cmake-build-debug-*
4+
.DS_Store
45
*.so
56
*.o
67
.idea

CMakeLists.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.10)
22
project(minter_tx
3-
VERSION 0.5.1
3+
VERSION 0.6.0
44
DESCRIPTION "Minter Transaction Maker"
55
LANGUAGES CXX
66
)
@@ -33,8 +33,9 @@ elseif (MINGW)
3333
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
3434
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
3535
else ()
36-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fvisibility=hidden -fPIC -Wextra -pedantic -Wno-unknown-pragmas -Wno-unused-parameter -Wno-shift-count-overflow")
37-
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -D_LIBCPP_DEBUG=1")
36+
#-fvisibility=hidden
37+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -Wextra -pedantic -Wno-unknown-pragmas -Wno-unused-parameter -Wno-shift-count-overflow")
38+
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
3839
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
3940
endif ()
4041

@@ -166,7 +167,9 @@ set(HEADERS
166167
include/minter/address.h
167168
include/minter/private_key.h
168169
include/minter/minter_tx_config.h
169-
include/minter/tx/check_tx.h include/minter/check.h)
170+
include/minter/tx/check_tx.h
171+
include/minter/check.h
172+
include/minter/tx/tx_deeplink.h)
170173

171174
set(SOURCES
172175
${HEADERS}
@@ -192,7 +195,7 @@ set(SOURCES
192195
src/tx/tx_builder.cpp
193196
src/data/public_key.cpp
194197
src/data/hash.cpp
195-
src/data/private_key.cpp src/tx/tx_data.cpp src/tx/check_tx.cpp src/data/check.cpp)
198+
src/data/private_key.cpp src/tx/tx_data.cpp src/tx/check_tx.cpp src/data/check.cpp src/tx/tx_deeplink.cpp)
196199

197200
set(MINTER_TX_EXPORTING 1)
198201
if (ENABLE_SHARED)
@@ -268,7 +271,8 @@ if (MINTER_TX_TEST)
268271
tests/rlp_test.cpp
269272
tests/address_test.cpp
270273
tests/pub_key_test.cpp
271-
tests/check_tx_test.cpp include/minter/eth/types.h)
274+
tests/check_tx_test.cpp
275+
tests/tx_create_multisig_address_test.cpp tests/tx_deeplink_test.cpp)
272276

273277
add_executable(${PROJECT_NAME_TEST} ${TEST_SOURCES})
274278
if (NOT MSVC)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ For more information, see official [docs](https://docs.conan.io/en/latest/gettin
5353
## Use as conan dependency without manually build
5454
You can just add to your conanfile.txt dependency:
5555

56-
`minter_tx/0.5.1@minter/latest`
56+
`minter_tx/0.6.0@minter/latest`
5757

5858
CMakeLists.txt
5959
```cmake
@@ -117,7 +117,7 @@ To build other configurations, just change `--config Debug` to one of: Release,
117117
## Examples:
118118
See here [link](examples)
119119

120-
#### Build mnemonic generator
120+
#### Bucket mnemonic generator
121121
```bash
122122
git clone --recursive https://github.com/MinterTeam/cpp-minter.git
123123
cd examples/generate

RELEASE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Release notes
22

3+
## 0.6.0
4+
- Fixed build for macos (removed LIBCPP_DEBUG flag)
5+
- Updated examples:
6+
- minter-pretty:
7+
- fixed searching by single word
8+
- minter-generator:
9+
- updated dependencies, using conanfile.py instead of conanfile.txt
10+
- Added multisig send test
11+
- Added test for CreateMultisigAddress transaction
12+
- Added external multisig and sign-only function to get only transaction signature without transaction hash
13+
- Added deeplink generator and parser
314
## 0.5.1
415
- Set boost version to 1.70 for compatibility
516

conanfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class MinterTxConan(ConanFile):
4949
default_channel = "latest"
5050

5151
requires = (
52-
'bip39/2.0.0@edwardstock/latest',
53-
'toolbox/3.1.0@edwardstock/latest',
52+
'bip39/2.0.1@edwardstock/latest',
53+
'toolbox/3.1.1@edwardstock/latest',
5454
'boost/1.70.0@conan/stable',
5555
)
5656

examples/generate/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Minter bucket mnemonic generator
2+
-------------------------
3+
4+
## Presequences
5+
**Conan** must be installed to build this example.
6+
7+
## Build
8+
```bash
9+
git clone --recursive https://github.com/MinterTeam/cpp-minter.git
10+
cd examples/generate
11+
mkdir build && cd build
12+
CONAN_LOCAL=1 cmake .. -DCMAKE_BUILD_TYPE=Debug
13+
CONAN_LOCAL=1 cmake --build . -- -j4
14+
```
15+
16+
## Run
17+
```bash
18+
./bin/minter-gen
19+
```
20+
21+
Or run with simple argument:
22+
```bash
23+
./bin/minter-gen 300
24+
```
25+
Generates 300 mnemonics and print it to stdout

examples/generate/conanfile.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import os
2+
from conans import ConanFile, CMake, tools
3+
4+
5+
class MinterTxConan(ConanFile):
6+
name = "minter_generator"
7+
version = "1.0.0"
8+
license = "MIT"
9+
author = "Eduard Maximovich edward.vstock@gmail.com"
10+
url = "https://github.com/MinterTeam/cpp-minter"
11+
description = "Example how to generate a bucket of minter wallets"
12+
topics = ("minter", "minter-network", "minter-blockchain", "blockchain", "tendermint")
13+
settings = "os", "compiler", "build_type", "arch"
14+
options = {"shared": [True, False]}
15+
default_options = {
16+
"shared": False,
17+
"boost:shared": False,
18+
"bip39:shared": False,
19+
"bip39:enableC": False,
20+
"bip39:enableJNI": False,
21+
}
22+
generators = "cmake"
23+
default_user = "minter"
24+
default_channel = "latest"
25+
26+
requires = (
27+
'minter_tx/0.6.0@minter/latest'
28+
)

examples/generate/conanfile.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/generate/main.cpp

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,41 @@
66
* \author Eduard Maximovich (edward.vstock@gmail.com)
77
* \link https://github.com/edwardstock
88
*/
9-
#include <sstream>
9+
#include <bip3x/Bip39Mnemonic.h>
1010
#include <iostream>
11-
#include <string>
12-
#include <stdexcept>
13-
14-
#include <minter/bip39/Bip39Mnemonic.h>
1511
#include <minter/address.h>
1612
#include <minter/private_key.h>
1713
#include <minter/public_key.h>
14+
#include <sstream>
15+
#include <stdexcept>
16+
#include <string>
1817

1918
int main(int argc, char** argv) {
2019

2120
int32_t n = 1;
2221

23-
if(argc > 1) {
22+
if (argc > 1) {
2423
try {
2524
n = std::stoi(argv[1]);
26-
if(n < 1) {
25+
if (n < 1) {
2726
throw std::invalid_argument("");
2827
}
29-
} catch (const std::invalid_argument &e) {
28+
} catch (const std::invalid_argument& e) {
3029
std::cerr << "unable to generate N mnemonics: invalid digit \"" << argv[1] << "\"" << std::endl;
3130
return 0xFF;
3231
}
3332
}
3433

3534
std::stringstream out_buff;
3635

37-
if(n > 10) {
38-
std::cout << "Processing...\n" << std::endl;
36+
if (n > 10) {
37+
std::cout << "Processing...\n"
38+
<< std::endl;
3939
}
4040

41-
for(size_t i = 0; i < n; i++) {
41+
for (size_t i = 0; i < n; i++) {
4242
// generate english mnemonic with default parameters
43-
auto mnemonic = minter::Bip39Mnemonic::generate();
43+
auto mnemonic = bip3x::Bip39Mnemonic::generate();
4444

4545
// getting raw mnemonic phrase
4646
std::string mnemonic_phrase = mnemonic.raw;
@@ -68,8 +68,5 @@ int main(int argc, char** argv) {
6868
std::cout << out_buff.str() << std::endl;
6969
out_buff.clear();
7070

71-
7271
return 0;
7372
}
74-
75-

0 commit comments

Comments
 (0)