Skip to content
Permalink
Browse files

remove unused code and fix some type error

  • Loading branch information...
enzoc4 committed Mar 12, 2019
1 parent b1621bf commit 71893f8fed3abb98be9d88578ec1dbd3d2ce6047
Showing with 3 additions and 14 deletions.
  1. +0 −11 cardano-c/cardano.h
  2. +3 −3 cardano-c/test/test_bip39_entropy.c
@@ -23,17 +23,6 @@ typedef enum _bip39_config_error
BIP39_INVALID_WORD_COUNT = 3
} cardano_bip39_error_t;

/* Error descriptions */
struct _errordesc {
int code;
char *message;
} errordesc[] = {
{ BIP39_SUCCESS, "No error" },
{ BIP39_INVALID_MNEMONIC, "Invalid mnemonic word" },
{ BIP39_INVALID_CHECKSUM, "Invalid checksum" },
{ BIP39_INVALID_WORD_COUNT, "The word count should be one of: 9, 12, 15, 18, 21, 24"}
};

typedef uint8_t* cardano_entropy;

/*!
@@ -6,7 +6,7 @@ void test_generate_entropy_from_mnemonics(void) {

cardano_entropy entropy;
uint32_t bytes;
int error = cardano_entropy_from_english_mnemonics(mnemonics, &entropy, &bytes);
cardano_bip39_error_t error = cardano_entropy_from_english_mnemonics(mnemonics, &entropy, &bytes);

uint8_t expected[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, entropy, 16);
@@ -19,7 +19,7 @@ void test_generate_entropy_from_mnemonics_error_code_invalid_word(void) {

cardano_entropy entropy;
uint32_t bytes;
int error = cardano_entropy_from_english_mnemonics(mnemonics, &entropy, &bytes);
cardano_bip39_error_t error = cardano_entropy_from_english_mnemonics(mnemonics, &entropy, &bytes);

TEST_ASSERT_EQUAL_HEX32(BIP39_INVALID_MNEMONIC, error);
}
@@ -29,7 +29,7 @@ void test_generate_entropy_from_mnemonics_invalid_checksum(void) {

cardano_entropy entropy;
uint32_t bytes;
int error = cardano_entropy_from_english_mnemonics(mnemonics, &entropy, &bytes);
cardano_bip39_error_t error = cardano_entropy_from_english_mnemonics(mnemonics, &entropy, &bytes);

TEST_ASSERT_EQUAL_HEX32(BIP39_INVALID_CHECKSUM, error);
}

0 comments on commit 71893f8

Please sign in to comment.
You can’t perform that action at this time.