Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
feat: Synchronize with entangled for MAM APIs
Browse files Browse the repository at this point in the history
In order to implement api_receive_mam_message(), some functions implemented
in the later commits are necessary.
  • Loading branch information
howjmay committed Mar 27, 2019
1 parent dd0d6be commit 15e5e43
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_r

git_repository(
name = "rules_iota",
commit = "b15744b9ea520717752c866d5afc769c3b6b68f3",
commit = "1cb59eea62fd1d071de213a9aa46e61e8273472d",
remote = "https://github.com/iotaledger/rules_iota.git",
)

git_repository(
name = "entangled",
commit = "8d847ffcecd50f8f3760bfee07d7ed33ecc067bf",
commit = "4960865730640d23e75ffbce84d3f74264cfcd28",
remote = "https://github.com/iotaledger/entangled.git",
)

Expand Down
6 changes: 2 additions & 4 deletions accelerator/common_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ status_t ta_send_trytes(const iota_config_t* const tangle,

done:
ta_get_tips_res_free(&get_txn_res);
attach_req->trytes = NULL;
attach_to_tangle_req_free(&attach_req);
attach_to_tangle_res_free(&attach_res);
return ret;
Expand Down Expand Up @@ -467,7 +466,7 @@ static int idx_sort(void const* lhs, void const* rhs) {
}

static void get_first_bundle_from_transactions(
transaction_array_t const transactions,
transaction_array_t const* transactions,
bundle_transactions_t* const bundle) {
iota_transaction_t* tail = NULL;
iota_transaction_t* curr_tx = NULL;
Expand All @@ -493,9 +492,8 @@ status_t ta_get_bundle(const iota_client_service_t* const service,
tryte_t const* const bundle_hash,
bundle_transactions_t* const bundle) {
status_t ret = SC_OK;
iota_transaction_t* curr_tx = NULL;
flex_trit_t bundle_hash_flex[FLEX_TRIT_SIZE_243];
transaction_array_t tx_objs = transaction_array_new();
transaction_array_t* tx_objs = transaction_array_new();
find_transactions_req_t* find_tx_req = find_transactions_req_new();
if (find_tx_req == NULL) {
ret = SC_CCLIENT_OOM;
Expand Down
6 changes: 4 additions & 2 deletions response/ta_get_transaction_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ ta_get_transaction_object_res_t* ta_get_transaction_object_res_new() {
}

void ta_get_transaction_object_res_free(ta_get_transaction_object_res_t** res) {
if (!res || !(*res) || !(*res)->txn) {
if (!res || !(*res)) {
return;
}

transaction_free((*res)->txn);
if ((*res)->txn) {
transaction_free((*res)->txn);
}
free(*res);
*res = NULL;
}
2 changes: 1 addition & 1 deletion tests/iota_api_mock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ retcode_t iota_client_find_transactions(

retcode_t iota_client_find_transaction_objects(
const iota_client_service_t* const service,
const find_transactions_req_t* const req, transaction_array_t tx_objs) {
const find_transactions_req_t* const req, transaction_array_t* tx_objs) {
flex_trit_t tx_trits[FLEX_TRIT_SIZE_8019];
iota_transaction_t tx;

Expand Down
4 changes: 2 additions & 2 deletions tests/iota_api_mock.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class IotaAPI {
}
virtual retcode_t iota_client_find_transaction_objects(
const iota_client_service_t* const service,
const find_transactions_req_t* const req, transaction_array_t tx_objs) {
const find_transactions_req_t* const req, transaction_array_t* tx_objs) {
return RC_OK;
}
virtual retcode_t iota_client_get_new_address(
Expand Down Expand Up @@ -71,7 +71,7 @@ class APIMock : public IotaAPI {
MOCK_METHOD3(iota_client_find_transaction_objects,
retcode_t(const iota_client_service_t* const service,
const find_transactions_req_t* const req,
transaction_array_t tx_objs));
transaction_array_t* tx_objs));
MOCK_METHOD4(iota_client_get_new_address,
retcode_t(iota_client_service_t const* const serv,
flex_trit_t const* const seed,
Expand Down

0 comments on commit 15e5e43

Please sign in to comment.