Skip to content

Commit

Permalink
fix some function signatures from libskycoin.h ref #108
Browse files Browse the repository at this point in the history
  • Loading branch information
Alvaro Denis committed Sep 10, 2019
1 parent 94769a3 commit c9e12bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/cgo/tests/check_cipher.address.common.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ START_TEST(TestAddressFromBytes)
cipher__SecKey sk;
cipher__PubKey pk;
GoSlice bytes;
GoSlice_ tempBytes;
GoSlice tempBytes;
GoUint8 buff[1024];
GoUint32 err = SKY_cipher_GenerateKeyPair(&pk, &sk);
ck_assert(err == SKY_OK);
Expand All @@ -80,7 +80,7 @@ START_TEST(TestAddressFromBytes)

SKY_cipher_Address_Bytes(&addr, &tempBytes);
ck_assert_msg(tempBytes.len > 0, "address bytes written");
copyGoSlice_toGoSlice(&bytes, &tempBytes, tempBytes.len);
copyGoSlice_toGoSlice(&bytes, (GoSlice_*)&tempBytes, tempBytes.len);
err = SKY_cipher_AddressFromBytes(bytes, &addr2);
ck_assert_msg(err == SKY_OK, "convert bytes to SKY address");

Expand All @@ -101,7 +101,7 @@ START_TEST(TestAddressFromBytes)

addr.Version = 2;
SKY_cipher_Address_Bytes(&addr, &tempBytes);
copyGoSlice_toGoSlice(&bytes, &tempBytes, tempBytes.len);
copyGoSlice_toGoSlice(&bytes, (GoSlice_*)&tempBytes, tempBytes.len);
err = SKY_cipher_AddressFromBytes(bytes, &addr2);
ck_assert_msg(err == SKY_ErrAddressInvalidVersion, "Invalid version");
}
Expand Down
6 changes: 3 additions & 3 deletions lib/cgo/tests/check_cipher.crypto.common.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ START_TEST(TestPubKeyHex)

GoUint32 err = SKY_cipher_GenerateKeyPair(&p, &sk);
ck_assert(err == SKY_OK);
GoString_ tmp_s3 = {buff_s3, 0};
GoString tmp_s3 = {buff_s3, 0};
err = SKY_cipher_PubKey_Hex(&p, &tmp_s3);
ck_assert(err == SKY_OK);
s3.n = tmp_s3.n;
Expand All @@ -115,7 +115,7 @@ START_TEST(TestPubKeyHex)
ck_assert(isPubKeyEq(&p, &p2));

unsigned char s4_buff[50];
GoString_ tmp_s4 = {s4_buff, 0};
GoString tmp_s4 = {s4_buff, 0};
err = SKY_cipher_PubKey_Hex(&p2, &tmp_s4);
ck_assert(err == SKY_OK);
s4.n = s4.n;
Expand Down Expand Up @@ -263,7 +263,7 @@ START_TEST(TestSigHex)

ck_assert(errorcode == SKY_OK);
char buffer[100];
GoString_ tmp_str = {buffer, 0};
GoString tmp_str = {buffer, 0};
SKY_cipher_Sig_Hex(&s, &tmp_str);
str.p = tmp_str.p;
str.n = tmp_str.n;
Expand Down
4 changes: 2 additions & 2 deletions lib/cgo/tests/check_cipher.hash.common.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ START_TEST(TestSHA256KnownValue)

SKY_cipher_SumSHA256(slice_input, &sha);

GoString_ tmp_output;
GoString tmp_output;

SKY_cipher_SHA256_Hex(&sha, &tmp_output);
registerMemCleanup((void*)tmp_output.p);
Expand Down Expand Up @@ -188,7 +188,7 @@ START_TEST(TestSHA256FromHex)
ck_assert(error == SKY_ErrInvalidHexLength);

// Valid hex hash
GoString_ s2;
GoString s2;
memset(&s2, 0, sizeof(GoString_));
SKY_cipher_SHA256_Hex(&h, &s2);
registerMemCleanup((void*)s2.p);
Expand Down

0 comments on commit c9e12bb

Please sign in to comment.