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

Add cache operations to ta_get_transaction_object #56

Merged
merged 4 commits into from
Jan 23, 2019

Conversation

wusyong
Copy link

@wusyong wusyong commented Jan 22, 2019

Add cache operations to ta_get_transaction_object and modify how it checks response, because get_trytes always return trytes even if transaction not found.

Part of #55

accelerator/common_core.c Outdated Show resolved Hide resolved
accelerator/common_core.c Outdated Show resolved Hide resolved
accelerator/common_core.c Outdated Show resolved Hide resolved
Yu Wei Wu added 3 commits January 23, 2019 12:00
Add cache operations to ta_get_transaction_object and modify how it
checks response, because get_trytes always return trytes even if
transaction not found.
get_transaction_obj would set value into cache after iota api called.
This may cause test case errors since they expect call iota api at least
one, but in reality they just find results in cache.
@@ -5,6 +5,8 @@
#include <stdlib.h>
#include <string.h>

#include "types/types.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this inclusion necessary?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For defined macros used in backeend_cache.c

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Affirmative. However, I would like to change the name scheme "types/types.h", which looks lousy. I'll propose changes later.

@@ -37,7 +37,7 @@ static int redis_get(redisContext* c, const char* const key, char* res) {

redisReply* reply = redisCommand(c, "GET %s", key);
if (reply->type == REDIS_REPLY_STRING) {
strcpy(res, reply->str);
strncpy(res, reply->str, FLEX_TRIT_SIZE_8019);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI. File hooks/scripts/cpplint.py searches for the occurrence of strcpy and warn.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It suggests snprintf.

@jserv jserv merged commit 1fcdc70 into DLTcollab:master Jan 23, 2019
@wusyong wusyong deleted the cache branch January 24, 2019 05:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants