Skip to content

Commit 749c731

Browse files
committed
mnemonics.json fixes for Core moved to bug-fixes.json
1 parent 67e161e commit 749c731

File tree

4 files changed

+47
-78
lines changed

4 files changed

+47
-78
lines changed

configs/forknote.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"multiply/bugged-zawy-difficulty-algorithm.json",
3434
"daemon-getrandom_outs-json.json",
3535
"simplewallet-import-keys.json",
36-
"simplewallet-export-keys.json"
36+
"simplewallet-export-keys.json",
37+
"mnemonics.json"
3738
],
3839
"base_coin": {
3940
"name": "bytecoin",

extensions/bug-fixes.json

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,38 @@
125125
]
126126
}
127127
},
128+
{
129+
"action": "add_above",
130+
"marker": "struct rs_comm {",
131+
"parameters": {
132+
"text": [
133+
" struct ec_point_pair {",
134+
" EllipticCurvePoint a, b;",
135+
" };"
136+
]
137+
}
138+
},
139+
{
140+
"action": "add_below",
141+
"marker": "struct rs_comm {",
142+
"parameters": {
143+
"text": [
144+
" Hash h;",
145+
" struct ec_point_pair ab[];",
146+
"};",
147+
"/*"
148+
]
149+
}
150+
},
151+
{
152+
"action": "add_above",
153+
"marker": "static inline size_t rs_comm_size(size_t pubs_count) {",
154+
"parameters": {
155+
"text": [
156+
"*/"
157+
]
158+
}
159+
},
128160
{
129161
"action": "add_above",
130162
"marker": "void crypto_ops::hash_data_to_ec(const uint8_t* data, std::size_t len, PublicKey& key) {",
@@ -146,24 +178,20 @@
146178
}
147179
]
148180
},
149-
150181
{
151-
"path": "/src/crypto/crypto.cpp",
152-
"description": "NOT WORKING",
153-
"multiline": true,
182+
"path": "/src/crypto/keccak.c",
154183
"changes": [
155184
{
156-
"action": "replace",
157-
"marker": "\\s+struct\\s+rs_comm\\s+{[^}]+}\\s+ab\\[\\];",
185+
"action": "add_above",
186+
"marker": "rsiz = sizeof(state_t) == mdlen ? HASH_DATA_AREA : 200 - 2 * mdlen;",
158187
"parameters": {
159188
"text": [
189+
"/* for some reason the enum from hash-ops.h is not valid here when",
190+
" compiling - is this a C vs C++ thing? Anyhow, lets just redefine it for",
191+
" now. */",
160192
"",
161-
" struct ec_point_pair {",
162-
" EllipticCurvePoint a, b;",
163-
" };",
164-
" struct rs_comm {",
165-
" Hash h;",
166-
" struct ec_point_pair ab[];"
193+
"const int HASH_DATA_AREA = 136;",
194+
""
167195
]
168196
}
169197
}

extensions/mnemonics.json

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -235,66 +235,6 @@
235235
""
236236
]
237237
}
238-
},
239-
{
240-
"action": "add_above",
241-
"marker": "struct rs_comm {",
242-
"parameters": {
243-
"text": [
244-
" struct ec_point_pair {",
245-
" EllipticCurvePoint a, b;",
246-
" };"
247-
]
248-
}
249-
},
250-
{
251-
"action": "add_below",
252-
"marker": "struct rs_comm {",
253-
"parameters": {
254-
"text": [
255-
" Hash h;",
256-
" struct ec_point_pair ab[];",
257-
"};",
258-
"/*"
259-
]
260-
}
261-
},
262-
{
263-
"action": "add_above",
264-
"marker": "static inline size_t rs_comm_size(size_t pubs_count) {",
265-
"parameters": {
266-
"text": [
267-
"*/"
268-
]
269-
}
270-
},
271-
{
272-
"action": "replace",
273-
"marker": "return sizeof(rs_comm) + pubs_count * sizeof(rs_comm().ab[0]);",
274-
"parameters": {
275-
"text": [
276-
"return sizeof(rs_comm) + pubs_count * sizeof(ec_point_pair);"
277-
]
278-
}
279-
}
280-
]
281-
},
282-
{
283-
"path": "/src/crypto/keccak.c",
284-
"changes": [
285-
{
286-
"action": "add_above",
287-
"marker": "rsiz = sizeof(state_t) == mdlen ? HASH_DATA_AREA : 200 - 2 * mdlen;",
288-
"parameters": {
289-
"text": [
290-
"/* for some reason the enum from hash-ops.h is not valid here when",
291-
" compiling - is this a C vs C++ thing? Anyhow, lets just redefine it for",
292-
" now. */",
293-
"",
294-
"const int HASH_DATA_AREA = 136;",
295-
""
296-
]
297-
}
298238
}
299239
]
300240
},

generator.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function finish {
2727
}
2828
trap finish EXIT
2929

30-
# Generate source code and compile
30+
# Generate source code and compile
3131
function generate_coin {
3232
# Define coin paths
3333
export BASE_COIN_PATH="${WORK_FOLDERS_PATH}/${__CONFIG_base_coin_name}"
@@ -59,7 +59,7 @@ function generate_coin {
5959
for extension in "${__CONFIG_extensions[@]}"
6060
do
6161
echo "${bold}Execute ${EXTENSIONS_PATH}/${extension}${normal}"
62-
python2 "lib/file-modification.py" --extension "${EXTENSIONS_PATH}/${extension}" --config=$CONFIG_FILE --source=${TEMP_PATH}
62+
python "lib/file-modification.py" --extension "${EXTENSIONS_PATH}/${extension}" --config=$CONFIG_FILE --source=${TEMP_PATH}
6363
done
6464

6565
[ -d "${NEW_COIN_PATH}" ] || mkdir -p "${NEW_COIN_PATH}"
@@ -93,7 +93,7 @@ Reads a config file and creates and compiles Cryptonote coin. "config.json" as d
9393
-f config file
9494
-c compile arguments
9595
EOF
96-
}
96+
}
9797

9898
# A POSIX variable
9999
OPTIND=1 # Reset in case getopts has been used previously in the shell.
@@ -123,14 +123,14 @@ if [[ "${CONFIG_FILE}" != /* ]]; then
123123
fi
124124

125125
if [ ! -f ${CONFIG_FILE} ]; then
126-
echo "ERROR: config file does not exist"
126+
echo "ERROR: config file does not exist"
127127
exit
128128
fi
129129

130130
[ -d "${WORK_FOLDERS_PATH}" ] || mkdir -p "${WORK_FOLDERS_PATH}"
131131

132132
# Get environment environment_variables
133-
python2 "lib/environment_variables.py" --config=$CONFIG_FILE --output=$BASH_CONFIG
133+
python "lib/environment_variables.py" --config=$CONFIG_FILE --output=$BASH_CONFIG
134134
if [ ! -f ${BASH_CONFIG} ]; then
135135
echo "Config file was not translated to bash."
136136
echo "Abort coin generation"

0 commit comments

Comments
 (0)