Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Erik Jansen
crown-core-test-new-gitlab-runner
Commits
68a60b43
Commit
68a60b43
authored
11 years ago
by
Jeff Garzik
Browse files
Options
Download
Email Patches
Plain Diff
Revert "Switch to using raw_utf8"
This reverts commit
2ecb7555
.
parent
3954e1d0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/bitcoinrpc.cpp
+5
-5
src/bitcoinrpc.cpp
src/qt/rpcconsole.cpp
+2
-2
src/qt/rpcconsole.cpp
src/test/base58_tests.cpp
+5
-5
src/test/base58_tests.cpp
src/test/script_tests.cpp
+2
-2
src/test/script_tests.cpp
src/test/transaction_tests.cpp
+2
-2
src/test/transaction_tests.cpp
with
16 additions
and
16 deletions
+16
-16
src/bitcoinrpc.cpp
View file @
68a60b43
...
...
@@ -533,7 +533,7 @@ string JSONRPCRequest(const string& strMethod, const Array& params, const Value&
request
.
push_back
(
Pair
(
"method"
,
strMethod
));
request
.
push_back
(
Pair
(
"params"
,
params
));
request
.
push_back
(
Pair
(
"id"
,
id
));
return
write_string
(
Value
(
request
),
raw_utf8
)
+
"
\n
"
;
return
write_string
(
Value
(
request
),
false
)
+
"
\n
"
;
}
Object
JSONRPCReplyObj
(
const
Value
&
result
,
const
Value
&
error
,
const
Value
&
id
)
...
...
@@ -551,7 +551,7 @@ Object JSONRPCReplyObj(const Value& result, const Value& error, const Value& id)
string
JSONRPCReply
(
const
Value
&
result
,
const
Value
&
error
,
const
Value
&
id
)
{
Object
reply
=
JSONRPCReplyObj
(
result
,
error
,
id
);
return
write_string
(
Value
(
reply
),
raw_utf8
)
+
"
\n
"
;
return
write_string
(
Value
(
reply
),
false
)
+
"
\n
"
;
}
void
ErrorReply
(
std
::
ostream
&
stream
,
const
Object
&
objError
,
const
Value
&
id
)
...
...
@@ -982,7 +982,7 @@ static string JSONRPCExecBatch(const Array& vReq)
for
(
unsigned
int
reqIdx
=
0
;
reqIdx
<
vReq
.
size
();
reqIdx
++
)
ret
.
push_back
(
JSONRPCExecOne
(
vReq
[
reqIdx
]));
return
write_string
(
Value
(
ret
),
raw_utf8
)
+
"
\n
"
;
return
write_string
(
Value
(
ret
),
false
)
+
"
\n
"
;
}
void
ServiceConnection
(
AcceptedConnection
*
conn
)
...
...
@@ -1284,7 +1284,7 @@ int CommandLineRPC(int argc, char *argv[])
if
(
error
.
type
()
!=
null_type
)
{
// Error
strPrint
=
"error: "
+
write_string
(
error
,
raw_utf8
);
strPrint
=
"error: "
+
write_string
(
error
,
false
);
int
code
=
find_value
(
error
.
get_obj
(),
"code"
).
get_int
();
nRet
=
abs
(
code
);
}
...
...
@@ -1296,7 +1296,7 @@ int CommandLineRPC(int argc, char *argv[])
else
if
(
result
.
type
()
==
str_type
)
strPrint
=
result
.
get_str
();
else
strPrint
=
write_string
(
result
,
pretty_print
|
raw_utf8
);
strPrint
=
write_string
(
result
,
true
);
}
}
catch
(
boost
::
thread_interrupted
)
{
...
...
This diff is collapsed.
Click to expand it.
src/qt/rpcconsole.cpp
View file @
68a60b43
...
...
@@ -159,7 +159,7 @@ void RPCExecutor::request(const QString &command)
else
if
(
result
.
type
()
==
json_spirit
::
str_type
)
strPrint
=
result
.
get_str
();
else
strPrint
=
write_string
(
result
,
json_spirit
::
pretty_print
|
json_spirit
::
raw_utf8
);
strPrint
=
write_string
(
result
,
true
);
emit
reply
(
RPCConsole
::
CMD_REPLY
,
QString
::
fromStdString
(
strPrint
));
}
...
...
@@ -173,7 +173,7 @@ void RPCExecutor::request(const QString &command)
}
catch
(
std
::
runtime_error
&
)
// raised when converting to invalid type, i.e. missing code or message
{
// Show raw JSON object
emit
reply
(
RPCConsole
::
CMD_ERROR
,
QString
::
fromStdString
(
write_string
(
json_spirit
::
Value
(
objError
),
json_spirit
::
raw_utf8
)));
emit
reply
(
RPCConsole
::
CMD_ERROR
,
QString
::
fromStdString
(
write_string
(
json_spirit
::
Value
(
objError
),
false
)));
}
}
catch
(
std
::
exception
&
e
)
...
...
This diff is collapsed.
Click to expand it.
src/test/base58_tests.cpp
View file @
68a60b43
...
...
@@ -20,7 +20,7 @@ BOOST_AUTO_TEST_CASE(base58_EncodeBase58)
BOOST_FOREACH
(
Value
&
tv
,
tests
)
{
Array
test
=
tv
.
get_array
();
std
::
string
strTest
=
write_string
(
tv
,
raw_utf8
);
std
::
string
strTest
=
write_string
(
tv
,
false
);
if
(
test
.
size
()
<
2
)
// Allow for extra stuff (useful for comments)
{
BOOST_ERROR
(
"Bad test: "
<<
strTest
);
...
...
@@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE(base58_DecodeBase58)
BOOST_FOREACH
(
Value
&
tv
,
tests
)
{
Array
test
=
tv
.
get_array
();
std
::
string
strTest
=
write_string
(
tv
,
raw_utf8
);
std
::
string
strTest
=
write_string
(
tv
,
false
);
if
(
test
.
size
()
<
2
)
// Allow for extra stuff (useful for comments)
{
BOOST_ERROR
(
"Bad test: "
<<
strTest
);
...
...
@@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_parse)
BOOST_FOREACH
(
Value
&
tv
,
tests
)
{
Array
test
=
tv
.
get_array
();
std
::
string
strTest
=
write_string
(
tv
,
raw_utf8
);
std
::
string
strTest
=
write_string
(
tv
,
false
);
if
(
test
.
size
()
<
3
)
// Allow for extra stuff (useful for comments)
{
BOOST_ERROR
(
"Bad test: "
<<
strTest
);
...
...
@@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen)
BOOST_FOREACH
(
Value
&
tv
,
tests
)
{
Array
test
=
tv
.
get_array
();
std
::
string
strTest
=
write_string
(
tv
,
raw_utf8
);
std
::
string
strTest
=
write_string
(
tv
,
false
);
if
(
test
.
size
()
<
3
)
// Allow for extra stuff (useful for comments)
{
BOOST_ERROR
(
"Bad test: "
<<
strTest
);
...
...
@@ -240,7 +240,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_invalid)
BOOST_FOREACH
(
Value
&
tv
,
tests
)
{
Array
test
=
tv
.
get_array
();
std
::
string
strTest
=
write_string
(
tv
,
raw_utf8
);
std
::
string
strTest
=
write_string
(
tv
,
false
);
if
(
test
.
size
()
<
1
)
// Allow for extra stuff (useful for comments)
{
BOOST_ERROR
(
"Bad test: "
<<
strTest
);
...
...
This diff is collapsed.
Click to expand it.
src/test/script_tests.cpp
View file @
68a60b43
...
...
@@ -118,7 +118,7 @@ BOOST_AUTO_TEST_CASE(script_valid)
BOOST_FOREACH
(
Value
&
tv
,
tests
)
{
Array
test
=
tv
.
get_array
();
string
strTest
=
write_string
(
tv
,
raw_utf8
);
string
strTest
=
write_string
(
tv
,
false
);
if
(
test
.
size
()
<
2
)
// Allow size > 2; extra stuff ignored (useful for comments)
{
BOOST_ERROR
(
"Bad test: "
<<
strTest
);
...
...
@@ -142,7 +142,7 @@ BOOST_AUTO_TEST_CASE(script_invalid)
BOOST_FOREACH
(
Value
&
tv
,
tests
)
{
Array
test
=
tv
.
get_array
();
string
strTest
=
write_string
(
tv
,
raw_utf8
);
string
strTest
=
write_string
(
tv
,
false
);
if
(
test
.
size
()
<
2
)
// Allow size > 2; extra stuff ignored (useful for comments)
{
BOOST_ERROR
(
"Bad test: "
<<
strTest
);
...
...
This diff is collapsed.
Click to expand it.
src/test/transaction_tests.cpp
View file @
68a60b43
...
...
@@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(tx_valid)
BOOST_FOREACH
(
Value
&
tv
,
tests
)
{
Array
test
=
tv
.
get_array
();
string
strTest
=
write_string
(
tv
,
raw_utf8
);
string
strTest
=
write_string
(
tv
,
false
);
if
(
test
[
0
].
type
()
==
array_type
)
{
if
(
test
.
size
()
!=
3
||
test
[
1
].
type
()
!=
str_type
||
test
[
2
].
type
()
!=
bool_type
)
...
...
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
BOOST_FOREACH
(
Value
&
tv
,
tests
)
{
Array
test
=
tv
.
get_array
();
string
strTest
=
write_string
(
tv
,
raw_utf8
);
string
strTest
=
write_string
(
tv
,
false
);
if
(
test
[
0
].
type
()
==
array_type
)
{
if
(
test
.
size
()
!=
3
||
test
[
1
].
type
()
!=
str_type
||
test
[
2
].
type
()
!=
bool_type
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment