Open Cavalierliu opened 1 year ago
BoatHlfabricWallet BoatHlfabricWalletInit(BUINT8 keypairIndex, BUINT8 networkIndex) { BoatHlfabricWallet wallet_ptr = NULL; BOAT_RESULT result = BOAT_SUCCESS; // BUINT8 i = 0;
/* allocate wallet memory */ wallet_ptr = BoatMalloc(sizeof(BoatHlfabricWallet)); if (wallet_ptr == NULL) { BoatLog(BOAT_LOG_CRITICAL, "Failed to malloc wallet memory."); return NULL; } result = BoATKeypair_GetKeypairByIndex(&(wallet_ptr->account_info.prikeyCtx), keypairIndex); if (result != BOAT_SUCCESS) { BoatLog(BOAT_LOG_CRITICAL, "get keypair by index fail"); return NULL; } result = BoATHlfabric_GetNetworkByIndex(&(wallet_ptr->network_info), networkIndex); if (result != BOAT_SUCCESS) { BoatLog(BOAT_LOG_CRITICAL, "get network by index fail"); return NULL; }
wallet_ptr->tlsCAchain.ca.field_len = 0; wallet_ptr->tlsCAchain.ca.field_ptr = NULL;
wallet_ptr->http2Context_ptr = NULL; /* network_info assignment */ // result += BoatHlfabricWalletSetNetworkInfo(wallet_ptr, config_ptr->nodesCfg); /* http2Context_ptr assignment */ wallet_ptr->http2Context_ptr = http2Init(); if (result != BOAT_SUCCESS) { BoatLog(BOAT_LOG_CRITICAL, "Failed to set accountInfo|TlsUInfo|networkInfo."); return NULL; } return wallet_ptr;
}
BoatHlfabricWallet BoatHlfabricWalletInit(BUINT8 keypairIndex, BUINT8 networkIndex) { BoatHlfabricWallet wallet_ptr = NULL; BOAT_RESULT result = BOAT_SUCCESS; // BUINT8 i = 0;
if (BOAT_HLFABRIC_TLS_SUPPORT == 1)
endif
}