test(ethereum): Add 006GetBalance_0001GetSuccess
#define TEST_GAS_PRICE "0x4A817C800"
#define TEST_IS_SYNC_TX BOAT_TRUE
#define TEST_RECIPIENT_ADDRESS "0xde4c806b372Df8857C97cF36A08D528bB8E261Bd"
+#define TEST_STOREREAD_ADDRESS "0x"
extern BoatEthWalletConfig get_ethereum_wallet_settings();
+START_TEST(test_006GetBalance_0001GetSuccess)
+{
+ BOAT_RESULT result;
+ BoatEthTx tx_ctx;
+ BCHAR *cur_balance_wei = NULL;
+ BoatFieldVariable parse_result = {NULL, 0};
+
+ BoatIotSdkInit();
+
+ ethereumWalletPrepare();
+
+ result = BoatEthTxInit(g_ethereum_wallet_ptr, &tx_ctx, BOAT_TRUE, NULL,
+ "0x333333",
+ (BCHAR *)TEST_RECIPIENT_ADDRESS);
+ ck_assert_int_eq(result, BOAT_SUCCESS);
+
+
+ cur_balance_wei = BoatEthWalletGetBalance(g_ethereum_wallet_ptr, NULL);
+ result = BoatEthParseRpcResponseStringResult(cur_balance_wei, &parse_result);
+
+ ck_assert_ptr_nonnull(parse_result.field_ptr);
+ ck_assert_int_eq(result, BOAT_SUCCESS);
+
+ BoatFree(parse_result.field_ptr);
+
+ BoatIotSdkDeInit();
+}
START_TEST(test_007Transfer_0001TransferSuccess)
{
@@ -81,6 +109,7 @@ Suite *make_transactions_suite(void)
suite_add_tcase(s_transaction, tc_transaction_api);
/* Test cases are added to the test set */
+ tcase_add_test(tc_transaction_api, test_006GetBalance_0001GetSuccess);
tcase_add_test(tc_transaction_api, test_007Transfer_0001TransferSuccess);
tcase_add_test(tc_transaction_api, test_007Transfer_0002TransferFailureNullParam);
