@@ -24,10 +24,9 @@ TEST(Signer, CosmosTransactionSign) {
24
24
auto signer = Signer (input);
25
25
auto output = signer.sign ();
26
26
27
- ASSERT_FALSE (output.has_error ());
28
- ASSERT_EQ (" " , output.encoded ());
27
+ ASSERT_TRUE (output.success ());
29
28
ASSERT_EQ (" {\" mode\" :\" block\" ,\" tx\" :{\" fee\" :{\" amount\" :[{\" amount\" :\" 5000\" ,\" denom\" :\" uatom\" }],\" gas\" :\" 200000\" },\" memo\" :\" Testing\" ,\" msg\" :[{\" type\" :\" cosmos-sdk/MsgSend\" ,\" value\" :{\" amount\" :[{\" amount\" :\" 995000\" ,\" denom\" :\" uatom\" }],\" from_address\" :\" cosmos1ufwv9ymhqaal6xz47n0jhzm2wf4empfqvjy575\" ,\" to_address\" :\" cosmos135qla4294zxarqhhgxsx0sw56yssa3z0f78pm0\" }}],\" signatures\" :[{\" pub_key\" :{\" type\" :\" tendermint/PubKeySecp256k1\" ,\" value\" :\" A6EsukEXB53GhohQVeDpxtkeH8KQIayd/Co/ApYRYkTm\" },\" signature\" :\" ULEpUqNzoAnYEx2x22F3ANAiPXquAU9+mqLWoAA/ZOUGTMsdb6vryzsW6AKX2Kqj1pGNdrTcQ58Z09JPyjpgEA==\" }],\" type\" :\" cosmos-sdk/MsgSend\" }}" ,
30
- output.json ());
29
+ output.output ());
31
30
}
32
31
33
32
TEST (Signer, BinanceTransactionSign) {
@@ -40,10 +39,9 @@ TEST(Signer, BinanceTransactionSign) {
40
39
auto signer = Signer (input);
41
40
auto output = signer.sign ();
42
41
43
- ASSERT_FALSE (output.has_error ());
44
- ASSERT_EQ (" " , output.json ());
42
+ ASSERT_TRUE (output.success ());
45
43
ASSERT_EQ (" ca01f0625dee0a4a2a2c87fa0a210a1412e654edef9e508b833736a987d069da5a89aedb12090a03424e4210cb8d5212210a1433bbf307b98146f13d20693cf946c2d77a4caf2812090a03424e4210cb8d52126d0a26eb5ae9872102e58176f271a9796b4288908be85094a2ac978e25535fd59a37b58626e3a84d9e1240015b4beb3d6ef366a7a92fd283f66b8f0d8cdb6b152a9189146b27f84f507f047e248517cf691a36ebc2b7f3b7f64e27585ce1c40f1928d119c31af428efcf3e1882671a0754657374696e672002" ,
46
- output.encoded ());
44
+ output.output ());
47
45
}
48
46
49
47
TEST (Signer, EthereumTransactionSign) {
@@ -56,10 +54,9 @@ TEST(Signer, EthereumTransactionSign) {
56
54
auto signer = Signer (input);
57
55
auto output = signer.sign ();
58
56
59
- ASSERT_FALSE (output.has_error ());
60
- ASSERT_EQ (" " , output.json ());
57
+ ASSERT_TRUE (output.success ());;
61
58
ASSERT_EQ (" f86a8084d693a400825208947d8bf18c7ce84b3e175b339c4ca93aed1dd166f1870348bca5a160008025a0fe5802b49e04c6b1705088310e133605ed8b549811a18968ad409ea02ad79f21a05bf845646fb1e1b9365f63a7fd5eb5e984094e3ed35c3bed7361aebbcbf41f10" ,
62
- output.encoded ());
59
+ output.output ());
63
60
}
64
61
65
62
TEST (Signer, NetworkNotSupported) {
@@ -72,7 +69,7 @@ TEST(Signer, NetworkNotSupported) {
72
69
auto signer = Signer (input);
73
70
auto output = signer.sign ();
74
71
75
- ASSERT_TRUE (output.has_error ());
72
+ ASSERT_FALSE (output.success ());
76
73
ASSERT_EQ (SignerErrorCodeNotSupported, output.error ().code ());
77
74
ASSERT_EQ (" Network not supported" , output.error ().description ());
78
75
}
@@ -87,6 +84,6 @@ TEST(Signer, InvalidJsonFormat) {
87
84
auto signer = Signer (input);
88
85
auto output = signer.sign ();
89
86
90
- ASSERT_TRUE (output.has_error ());
87
+ ASSERT_FALSE (output.success ());
91
88
ASSERT_EQ (SignerErrorCodeInvalidJson, output.error ().code ());
92
89
}
0 commit comments