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

Code refactor #60

Merged
merged 3 commits into from
Jan 25, 2019
Merged

Code refactor #60

merged 3 commits into from
Jan 25, 2019

Conversation

jkrvivian
Copy link
Member

  • accelerator/common_core.c: Add ret_code checking
  • tests/test_serializer.c: Replace constant with macro for consistency
  • tests/test_common.cc: Compare trits with memcmp to remove redundant tryte_trit conversion

@@ -4,50 +4,72 @@

int cclient_get_txn_to_approve(const iota_client_service_t* const service,
ta_get_tips_res_t* res) {
if (res == NULL) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you denote the return code listing in core implementation? We shall have conventions in common.

Copy link
Member Author

Choose a reason for hiding this comment

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

Two situation here:

  • If the function has return value (mostly from entangled), return it directly
  • Return -1 for other checks
    • Check if arguments are valid before execution
    • Check if objects are valid after xxx_new()

Copy link
Member

Choose a reason for hiding this comment

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

Send another pull request to append return code information for public functions, then can be generated into API Reference Manual later.

Copy link
Member Author

@jkrvivian jkrvivian Jan 25, 2019

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Exactly.

@jserv jserv merged commit 26468a6 into DLTcollab:master Jan 25, 2019
@jkrvivian jkrvivian deleted the code_refactor branch February 20, 2019 08:35
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.

2 participants