-fix FTBFS
This commit is contained in:
parent
8cb0b890d3
commit
fdfcb29027
@ -214,7 +214,7 @@ destroy_denom_key_pair (struct DenomKeyPair *dkp)
|
|||||||
*/
|
*/
|
||||||
static struct DenomKeyPair *
|
static struct DenomKeyPair *
|
||||||
create_denom_key_pair (unsigned int size,
|
create_denom_key_pair (unsigned int size,
|
||||||
struct GNUNET_TIME_Absolute now,
|
struct GNUNET_TIME_Timestamp now,
|
||||||
const struct TALER_Amount *value,
|
const struct TALER_Amount *value,
|
||||||
const struct TALER_Amount *fee_withdraw,
|
const struct TALER_Amount *fee_withdraw,
|
||||||
const struct TALER_Amount *fee_deposit,
|
const struct TALER_Amount *fee_deposit,
|
||||||
@ -237,21 +237,24 @@ create_denom_key_pair (unsigned int size,
|
|||||||
0,
|
0,
|
||||||
sizeof (struct TALER_EXCHANGEDB_DenominationKey));
|
sizeof (struct TALER_EXCHANGEDB_DenominationKey));
|
||||||
dki.denom_pub = dkp->pub;
|
dki.denom_pub = dkp->pub;
|
||||||
GNUNET_TIME_round_abs (&now);
|
dki.issue.properties.start = GNUNET_TIME_timestamp_hton (now);
|
||||||
dki.issue.properties.start = GNUNET_TIME_absolute_hton (now);
|
dki.issue.properties.expire_withdraw = GNUNET_TIME_timestamp_hton
|
||||||
dki.issue.properties.expire_withdraw = GNUNET_TIME_absolute_hton
|
(GNUNET_TIME_absolute_to_timestamp
|
||||||
(GNUNET_TIME_absolute_add (now,
|
(GNUNET_TIME_absolute_add (
|
||||||
GNUNET_TIME_UNIT_HOURS));
|
now.abs_time,
|
||||||
dki.issue.properties.expire_deposit = GNUNET_TIME_absolute_hton
|
GNUNET_TIME_UNIT_HOURS)));
|
||||||
|
dki.issue.properties.expire_deposit = GNUNET_TIME_timestamp_hton (
|
||||||
|
GNUNET_TIME_absolute_to_timestamp
|
||||||
(GNUNET_TIME_absolute_add
|
(GNUNET_TIME_absolute_add
|
||||||
(now,
|
(now.abs_time,
|
||||||
GNUNET_TIME_relative_multiply (
|
GNUNET_TIME_relative_multiply (
|
||||||
GNUNET_TIME_UNIT_HOURS, 2)));
|
GNUNET_TIME_UNIT_HOURS, 2))));
|
||||||
dki.issue.properties.expire_legal = GNUNET_TIME_absolute_hton
|
dki.issue.properties.expire_legal = GNUNET_TIME_timestamp_hton (
|
||||||
|
GNUNET_TIME_absolute_to_timestamp
|
||||||
(GNUNET_TIME_absolute_add
|
(GNUNET_TIME_absolute_add
|
||||||
(now,
|
(now.abs_time,
|
||||||
GNUNET_TIME_relative_multiply (
|
GNUNET_TIME_relative_multiply (
|
||||||
GNUNET_TIME_UNIT_HOURS, 3)));
|
GNUNET_TIME_UNIT_HOURS, 3))));
|
||||||
TALER_amount_hton (&dki.issue.properties.value, value);
|
TALER_amount_hton (&dki.issue.properties.value, value);
|
||||||
TALER_amount_hton (&dki.issue.properties.fee_withdraw, fee_withdraw);
|
TALER_amount_hton (&dki.issue.properties.fee_withdraw, fee_withdraw);
|
||||||
TALER_amount_hton (&dki.issue.properties.fee_deposit, fee_deposit);
|
TALER_amount_hton (&dki.issue.properties.fee_deposit, fee_deposit);
|
||||||
@ -506,7 +509,7 @@ test_melting (void)
|
|||||||
struct TALER_DenominationPublicKey *new_denom_pubs;
|
struct TALER_DenominationPublicKey *new_denom_pubs;
|
||||||
enum GNUNET_GenericReturnValue ret;
|
enum GNUNET_GenericReturnValue ret;
|
||||||
enum GNUNET_DB_QueryStatus qs;
|
enum GNUNET_DB_QueryStatus qs;
|
||||||
struct GNUNET_TIME_Absolute now;
|
struct GNUNET_TIME_Timestamp now;
|
||||||
|
|
||||||
ret = GNUNET_SYSERR;
|
ret = GNUNET_SYSERR;
|
||||||
RND_BLK (&refresh_session);
|
RND_BLK (&refresh_session);
|
||||||
@ -516,8 +519,7 @@ test_melting (void)
|
|||||||
/* create and test a refresh session */
|
/* create and test a refresh session */
|
||||||
refresh_session.noreveal_index = MELT_NOREVEAL_INDEX;
|
refresh_session.noreveal_index = MELT_NOREVEAL_INDEX;
|
||||||
/* create a denomination (value: 1; fraction: 100) */
|
/* create a denomination (value: 1; fraction: 100) */
|
||||||
now = GNUNET_TIME_absolute_get ();
|
now = GNUNET_TIME_timestamp_get ();
|
||||||
GNUNET_TIME_round_abs (&now);
|
|
||||||
dkp = create_denom_key_pair (512,
|
dkp = create_denom_key_pair (512,
|
||||||
now,
|
now,
|
||||||
&value,
|
&value,
|
||||||
@ -614,10 +616,9 @@ test_melting (void)
|
|||||||
for (unsigned int cnt = 0; cnt < MELT_NEW_COINS; cnt++)
|
for (unsigned int cnt = 0; cnt < MELT_NEW_COINS; cnt++)
|
||||||
{
|
{
|
||||||
struct TALER_EXCHANGEDB_RefreshRevealedCoin *ccoin;
|
struct TALER_EXCHANGEDB_RefreshRevealedCoin *ccoin;
|
||||||
struct GNUNET_TIME_Absolute now;
|
struct GNUNET_TIME_Timestamp now;
|
||||||
|
|
||||||
now = GNUNET_TIME_absolute_get ();
|
now = GNUNET_TIME_timestamp_get ();
|
||||||
GNUNET_TIME_round_abs (&now);
|
|
||||||
new_dkp[cnt] = create_denom_key_pair (RSA_KEY_SIZE,
|
new_dkp[cnt] = create_denom_key_pair (RSA_KEY_SIZE,
|
||||||
now,
|
now,
|
||||||
&value,
|
&value,
|
||||||
@ -714,7 +715,7 @@ cb_wt_never (void *cls,
|
|||||||
uint64_t serial_id,
|
uint64_t serial_id,
|
||||||
const struct TALER_MerchantPublicKeyP *merchant_pub,
|
const struct TALER_MerchantPublicKeyP *merchant_pub,
|
||||||
const char *account_payto_uri,
|
const char *account_payto_uri,
|
||||||
struct GNUNET_TIME_Absolute exec_time,
|
struct GNUNET_TIME_Timestamp exec_time,
|
||||||
const struct TALER_PrivateContractHash *h_contract_terms,
|
const struct TALER_PrivateContractHash *h_contract_terms,
|
||||||
const struct TALER_DenominationPublicKey *denom_pub,
|
const struct TALER_DenominationPublicKey *denom_pub,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
@ -742,7 +743,7 @@ static struct TALER_CoinSpendPublicKeyP coin_pub_wt;
|
|||||||
static struct TALER_Amount coin_value_wt;
|
static struct TALER_Amount coin_value_wt;
|
||||||
static struct TALER_Amount coin_fee_wt;
|
static struct TALER_Amount coin_fee_wt;
|
||||||
static struct TALER_Amount transfer_value_wt;
|
static struct TALER_Amount transfer_value_wt;
|
||||||
static struct GNUNET_TIME_Absolute wire_out_date;
|
static struct GNUNET_TIME_Timestamp wire_out_date;
|
||||||
static struct TALER_WireTransferIdentifierRawP wire_out_wtid;
|
static struct TALER_WireTransferIdentifierRawP wire_out_wtid;
|
||||||
|
|
||||||
|
|
||||||
@ -754,7 +755,7 @@ cb_wt_check (void *cls,
|
|||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
const struct TALER_MerchantPublicKeyP *merchant_pub,
|
const struct TALER_MerchantPublicKeyP *merchant_pub,
|
||||||
const char *account_payto_uri,
|
const char *account_payto_uri,
|
||||||
struct GNUNET_TIME_Absolute exec_time,
|
struct GNUNET_TIME_Timestamp exec_time,
|
||||||
const struct TALER_PrivateContractHash *h_contract_terms,
|
const struct TALER_PrivateContractHash *h_contract_terms,
|
||||||
const struct TALER_DenominationPublicKey *denom_pub,
|
const struct TALER_DenominationPublicKey *denom_pub,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
@ -768,7 +769,9 @@ cb_wt_check (void *cls,
|
|||||||
&merchant_pub_wt));
|
&merchant_pub_wt));
|
||||||
GNUNET_assert (0 == strcmp (account_payto_uri,
|
GNUNET_assert (0 == strcmp (account_payto_uri,
|
||||||
"payto://iban/DE67830654080004822650?receiver-name=Test"));
|
"payto://iban/DE67830654080004822650?receiver-name=Test"));
|
||||||
GNUNET_assert (exec_time.abs_value_us == wire_out_date.abs_value_us);
|
GNUNET_assert (GNUNET_TIME_timestamp_cmp (exec_time,
|
||||||
|
==,
|
||||||
|
wire_out_date));
|
||||||
GNUNET_assert (0 == GNUNET_memcmp (h_contract_terms,
|
GNUNET_assert (0 == GNUNET_memcmp (h_contract_terms,
|
||||||
&h_contract_terms_wt));
|
&h_contract_terms_wt));
|
||||||
GNUNET_assert (0 == GNUNET_memcmp (coin_pub,
|
GNUNET_assert (0 == GNUNET_memcmp (coin_pub,
|
||||||
@ -901,7 +904,7 @@ matching_deposit_cb (void *cls,
|
|||||||
static enum GNUNET_GenericReturnValue
|
static enum GNUNET_GenericReturnValue
|
||||||
audit_deposit_cb (void *cls,
|
audit_deposit_cb (void *cls,
|
||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
struct GNUNET_TIME_Absolute exchange_timestamp,
|
struct GNUNET_TIME_Timestamp exchange_timestamp,
|
||||||
const struct TALER_EXCHANGEDB_Deposit *deposit,
|
const struct TALER_EXCHANGEDB_Deposit *deposit,
|
||||||
const struct TALER_DenominationPublicKey *denom_pub,
|
const struct TALER_DenominationPublicKey *denom_pub,
|
||||||
bool done)
|
bool done)
|
||||||
@ -977,7 +980,7 @@ audit_reserve_in_cb (void *cls,
|
|||||||
const struct TALER_Amount *credit,
|
const struct TALER_Amount *credit,
|
||||||
const char *sender_account_details,
|
const char *sender_account_details,
|
||||||
uint64_t wire_reference,
|
uint64_t wire_reference,
|
||||||
struct GNUNET_TIME_Absolute execution_date)
|
struct GNUNET_TIME_Timestamp execution_date)
|
||||||
{
|
{
|
||||||
(void) cls;
|
(void) cls;
|
||||||
(void) rowid;
|
(void) rowid;
|
||||||
@ -1011,7 +1014,7 @@ audit_reserve_out_cb (void *cls,
|
|||||||
const struct TALER_DenominationPublicKey *denom_pub,
|
const struct TALER_DenominationPublicKey *denom_pub,
|
||||||
const struct TALER_ReservePublicKeyP *reserve_pub,
|
const struct TALER_ReservePublicKeyP *reserve_pub,
|
||||||
const struct TALER_ReserveSignatureP *reserve_sig,
|
const struct TALER_ReserveSignatureP *reserve_sig,
|
||||||
struct GNUNET_TIME_Absolute execution_date,
|
struct GNUNET_TIME_Timestamp execution_date,
|
||||||
const struct TALER_Amount *amount_with_fee)
|
const struct TALER_Amount *amount_with_fee)
|
||||||
{
|
{
|
||||||
(void) cls;
|
(void) cls;
|
||||||
@ -1036,17 +1039,17 @@ static enum GNUNET_GenericReturnValue
|
|||||||
test_gc (void)
|
test_gc (void)
|
||||||
{
|
{
|
||||||
struct DenomKeyPair *dkp;
|
struct DenomKeyPair *dkp;
|
||||||
struct GNUNET_TIME_Absolute now;
|
struct GNUNET_TIME_Timestamp now;
|
||||||
struct GNUNET_TIME_Absolute past;
|
struct GNUNET_TIME_Timestamp past;
|
||||||
struct TALER_EXCHANGEDB_DenominationKeyInformationP issue2;
|
struct TALER_EXCHANGEDB_DenominationKeyInformationP issue2;
|
||||||
struct TALER_DenominationHash denom_hash;
|
struct TALER_DenominationHash denom_hash;
|
||||||
|
|
||||||
now = GNUNET_TIME_absolute_get ();
|
now = GNUNET_TIME_timestamp_get ();
|
||||||
GNUNET_TIME_round_abs (&now);
|
past = GNUNET_TIME_absolute_to_timestamp (
|
||||||
past = GNUNET_TIME_absolute_subtract (now,
|
GNUNET_TIME_absolute_subtract (now.abs_time,
|
||||||
GNUNET_TIME_relative_multiply (
|
GNUNET_TIME_relative_multiply (
|
||||||
GNUNET_TIME_UNIT_HOURS,
|
GNUNET_TIME_UNIT_HOURS,
|
||||||
4));
|
4)));
|
||||||
dkp = create_denom_key_pair (RSA_KEY_SIZE,
|
dkp = create_denom_key_pair (RSA_KEY_SIZE,
|
||||||
past,
|
past,
|
||||||
&value,
|
&value,
|
||||||
@ -1087,21 +1090,19 @@ test_gc (void)
|
|||||||
static enum GNUNET_GenericReturnValue
|
static enum GNUNET_GenericReturnValue
|
||||||
test_wire_fees (void)
|
test_wire_fees (void)
|
||||||
{
|
{
|
||||||
struct GNUNET_TIME_Absolute start_date;
|
struct GNUNET_TIME_Timestamp start_date;
|
||||||
struct GNUNET_TIME_Absolute end_date;
|
struct GNUNET_TIME_Timestamp end_date;
|
||||||
struct TALER_Amount wire_fee;
|
struct TALER_Amount wire_fee;
|
||||||
struct TALER_Amount closing_fee;
|
struct TALER_Amount closing_fee;
|
||||||
struct TALER_MasterSignatureP master_sig;
|
struct TALER_MasterSignatureP master_sig;
|
||||||
struct GNUNET_TIME_Absolute sd;
|
struct GNUNET_TIME_Timestamp sd;
|
||||||
struct GNUNET_TIME_Absolute ed;
|
struct GNUNET_TIME_Timestamp ed;
|
||||||
struct TALER_Amount fee;
|
struct TALER_Amount fee;
|
||||||
struct TALER_Amount fee2;
|
struct TALER_Amount fee2;
|
||||||
struct TALER_MasterSignatureP ms;
|
struct TALER_MasterSignatureP ms;
|
||||||
|
|
||||||
start_date = GNUNET_TIME_absolute_get ();
|
start_date = GNUNET_TIME_timestamp_get ();
|
||||||
GNUNET_TIME_round_abs (&start_date);
|
end_date = GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_MINUTES);
|
||||||
end_date = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES);
|
|
||||||
GNUNET_TIME_round_abs (&end_date);
|
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
TALER_string_to_amount (CURRENCY ":1.424242",
|
TALER_string_to_amount (CURRENCY ":1.424242",
|
||||||
&wire_fee));
|
&wire_fee));
|
||||||
@ -1163,8 +1164,12 @@ test_wire_fees (void)
|
|||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
if ( (sd.abs_value_us != start_date.abs_value_us) ||
|
if ( (GNUNET_TIME_timestamp_cmp (sd,
|
||||||
(ed.abs_value_us != end_date.abs_value_us) ||
|
!=,
|
||||||
|
start_date)) ||
|
||||||
|
(GNUNET_TIME_timestamp_cmp (ed,
|
||||||
|
!=,
|
||||||
|
end_date)) ||
|
||||||
(0 != TALER_amount_cmp (&fee,
|
(0 != TALER_amount_cmp (&fee,
|
||||||
&wire_fee)) ||
|
&wire_fee)) ||
|
||||||
(0 != TALER_amount_cmp (&fee2,
|
(0 != TALER_amount_cmp (&fee2,
|
||||||
@ -1196,7 +1201,7 @@ static struct TALER_Amount wire_out_amount;
|
|||||||
static enum GNUNET_GenericReturnValue
|
static enum GNUNET_GenericReturnValue
|
||||||
audit_wire_cb (void *cls,
|
audit_wire_cb (void *cls,
|
||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
struct GNUNET_TIME_Absolute date,
|
struct GNUNET_TIME_Timestamp date,
|
||||||
const struct TALER_WireTransferIdentifierRawP *wtid,
|
const struct TALER_WireTransferIdentifierRawP *wtid,
|
||||||
const char *payto_uri,
|
const char *payto_uri,
|
||||||
const struct TALER_Amount *amount)
|
const struct TALER_Amount *amount)
|
||||||
@ -1211,7 +1216,9 @@ audit_wire_cb (void *cls,
|
|||||||
GNUNET_assert (0 ==
|
GNUNET_assert (0 ==
|
||||||
GNUNET_memcmp (wtid,
|
GNUNET_memcmp (wtid,
|
||||||
&wire_out_wtid));
|
&wire_out_wtid));
|
||||||
GNUNET_assert (date.abs_value_us == wire_out_date.abs_value_us);
|
GNUNET_assert (GNUNET_TIME_timestamp_cmp (date,
|
||||||
|
==,
|
||||||
|
wire_out_date));
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1228,8 +1235,7 @@ test_wire_out (const struct TALER_EXCHANGEDB_Deposit *deposit)
|
|||||||
memset (&wire_out_wtid,
|
memset (&wire_out_wtid,
|
||||||
42,
|
42,
|
||||||
sizeof (wire_out_wtid));
|
sizeof (wire_out_wtid));
|
||||||
wire_out_date = GNUNET_TIME_absolute_get ();
|
wire_out_date = GNUNET_TIME_timestamp_get ();
|
||||||
(void) GNUNET_TIME_round_abs (&wire_out_date);
|
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
TALER_string_to_amount (CURRENCY ":1",
|
TALER_string_to_amount (CURRENCY ":1",
|
||||||
&wire_out_amount));
|
&wire_out_amount));
|
||||||
@ -1263,7 +1269,7 @@ test_wire_out (const struct TALER_EXCHANGEDB_Deposit *deposit)
|
|||||||
struct TALER_WireTransferIdentifierRawP wtid2;
|
struct TALER_WireTransferIdentifierRawP wtid2;
|
||||||
struct TALER_Amount coin_contribution2;
|
struct TALER_Amount coin_contribution2;
|
||||||
struct TALER_Amount coin_fee2;
|
struct TALER_Amount coin_fee2;
|
||||||
struct GNUNET_TIME_Absolute execution_time2;
|
struct GNUNET_TIME_Timestamp execution_time2;
|
||||||
struct TALER_EXCHANGEDB_KycStatus kyc;
|
struct TALER_EXCHANGEDB_KycStatus kyc;
|
||||||
|
|
||||||
h_contract_terms_wt2.hash.bits[0]++;
|
h_contract_terms_wt2.hash.bits[0]++;
|
||||||
@ -1321,7 +1327,7 @@ test_wire_out (const struct TALER_EXCHANGEDB_Deposit *deposit)
|
|||||||
struct TALER_WireTransferIdentifierRawP wtid2;
|
struct TALER_WireTransferIdentifierRawP wtid2;
|
||||||
struct TALER_Amount coin_contribution2;
|
struct TALER_Amount coin_contribution2;
|
||||||
struct TALER_Amount coin_fee2;
|
struct TALER_Amount coin_fee2;
|
||||||
struct GNUNET_TIME_Absolute execution_time2;
|
struct GNUNET_TIME_Timestamp execution_time2;
|
||||||
struct TALER_EXCHANGEDB_KycStatus kyc;
|
struct TALER_EXCHANGEDB_KycStatus kyc;
|
||||||
|
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||||
@ -1338,8 +1344,9 @@ test_wire_out (const struct TALER_EXCHANGEDB_Deposit *deposit)
|
|||||||
&kyc));
|
&kyc));
|
||||||
GNUNET_assert (0 == GNUNET_memcmp (&wtid2,
|
GNUNET_assert (0 == GNUNET_memcmp (&wtid2,
|
||||||
&wire_out_wtid));
|
&wire_out_wtid));
|
||||||
GNUNET_assert (execution_time2.abs_value_us ==
|
GNUNET_assert (GNUNET_TIME_timestamp_cmp (execution_time2,
|
||||||
wire_out_date.abs_value_us);
|
==,
|
||||||
|
wire_out_date));
|
||||||
GNUNET_assert (0 == TALER_amount_cmp (&coin_contribution2,
|
GNUNET_assert (0 == TALER_amount_cmp (&coin_contribution2,
|
||||||
&coin_value_wt));
|
&coin_value_wt));
|
||||||
GNUNET_assert (0 == TALER_amount_cmp (&coin_fee2,
|
GNUNET_assert (0 == TALER_amount_cmp (&coin_fee2,
|
||||||
@ -1375,7 +1382,7 @@ drop:
|
|||||||
static enum GNUNET_GenericReturnValue
|
static enum GNUNET_GenericReturnValue
|
||||||
recoup_cb (void *cls,
|
recoup_cb (void *cls,
|
||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
struct GNUNET_TIME_Absolute timestamp,
|
struct GNUNET_TIME_Timestamp timestamp,
|
||||||
const struct TALER_Amount *amount,
|
const struct TALER_Amount *amount,
|
||||||
const struct TALER_ReservePublicKeyP *reserve_pub,
|
const struct TALER_ReservePublicKeyP *reserve_pub,
|
||||||
const struct TALER_CoinPublicInfo *coin,
|
const struct TALER_CoinPublicInfo *coin,
|
||||||
@ -1420,7 +1427,7 @@ wire_missing_cb (void *cls,
|
|||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_Amount *amount,
|
const struct TALER_Amount *amount,
|
||||||
const char *payto_uri,
|
const char *payto_uri,
|
||||||
struct GNUNET_TIME_Absolute deadline,
|
struct GNUNET_TIME_Timestamp deadline,
|
||||||
bool tiny,
|
bool tiny,
|
||||||
bool done)
|
bool done)
|
||||||
{
|
{
|
||||||
@ -1488,7 +1495,7 @@ run (void *cls)
|
|||||||
{
|
{
|
||||||
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
|
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
|
||||||
struct TALER_CoinSpendSignatureP coin_sig;
|
struct TALER_CoinSpendSignatureP coin_sig;
|
||||||
struct GNUNET_TIME_Absolute deadline;
|
struct GNUNET_TIME_Timestamp deadline;
|
||||||
union TALER_DenominationBlindingKeyP coin_blind;
|
union TALER_DenominationBlindingKeyP coin_blind;
|
||||||
struct TALER_ReservePublicKeyP reserve_pub;
|
struct TALER_ReservePublicKeyP reserve_pub;
|
||||||
struct TALER_ReservePublicKeyP reserve_pub2;
|
struct TALER_ReservePublicKeyP reserve_pub2;
|
||||||
@ -1510,7 +1517,7 @@ run (void *cls)
|
|||||||
unsigned int cnt;
|
unsigned int cnt;
|
||||||
uint64_t rr;
|
uint64_t rr;
|
||||||
enum GNUNET_DB_QueryStatus qs;
|
enum GNUNET_DB_QueryStatus qs;
|
||||||
struct GNUNET_TIME_Absolute now;
|
struct GNUNET_TIME_Timestamp now;
|
||||||
struct TALER_WireSalt salt;
|
struct TALER_WireSalt salt;
|
||||||
union TALER_DenominationBlindingKeyP bks;
|
union TALER_DenominationBlindingKeyP bks;
|
||||||
struct TALER_CoinPubHash c_hash;
|
struct TALER_CoinPubHash c_hash;
|
||||||
@ -1574,8 +1581,7 @@ run (void *cls)
|
|||||||
plugin->get_latest_reserve_in_reference (plugin->cls,
|
plugin->get_latest_reserve_in_reference (plugin->cls,
|
||||||
"exchange-account-1",
|
"exchange-account-1",
|
||||||
&rr));
|
&rr));
|
||||||
now = GNUNET_TIME_absolute_get ();
|
now = GNUNET_TIME_timestamp_get ();
|
||||||
(void) GNUNET_TIME_round_abs (&now);
|
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||||
plugin->reserves_in_insert (plugin->cls,
|
plugin->reserves_in_insert (plugin->cls,
|
||||||
&reserve_pub,
|
&reserve_pub,
|
||||||
@ -1594,8 +1600,7 @@ run (void *cls)
|
|||||||
value.value,
|
value.value,
|
||||||
value.fraction,
|
value.fraction,
|
||||||
value.currency));
|
value.currency));
|
||||||
now = GNUNET_TIME_absolute_get ();
|
now = GNUNET_TIME_timestamp_get ();
|
||||||
(void) GNUNET_TIME_round_abs (&now);
|
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||||
plugin->reserves_in_insert (plugin->cls,
|
plugin->reserves_in_insert (plugin->cls,
|
||||||
&reserve_pub,
|
&reserve_pub,
|
||||||
@ -1619,8 +1624,7 @@ run (void *cls)
|
|||||||
value.fraction * 2,
|
value.fraction * 2,
|
||||||
value.currency));
|
value.currency));
|
||||||
result = 5;
|
result = 5;
|
||||||
now = GNUNET_TIME_absolute_get ();
|
now = GNUNET_TIME_timestamp_get ();
|
||||||
(void) GNUNET_TIME_round_abs (&now);
|
|
||||||
dkp = create_denom_key_pair (RSA_KEY_SIZE,
|
dkp = create_denom_key_pair (RSA_KEY_SIZE,
|
||||||
now,
|
now,
|
||||||
&value,
|
&value,
|
||||||
@ -1727,9 +1731,7 @@ run (void *cls)
|
|||||||
&cbc.sig,
|
&cbc.sig,
|
||||||
&bks,
|
&bks,
|
||||||
&dkp->pub));
|
&dkp->pub));
|
||||||
|
deadline = GNUNET_TIME_timestamp_get ();
|
||||||
deadline = GNUNET_TIME_absolute_get ();
|
|
||||||
(void) GNUNET_TIME_round_abs (&deadline);
|
|
||||||
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
||||||
plugin->ensure_coin_known (plugin->cls,
|
plugin->ensure_coin_known (plugin->cls,
|
||||||
&deposit.coin));
|
&deposit.coin));
|
||||||
@ -1779,8 +1781,7 @@ run (void *cls)
|
|||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
TALER_string_to_amount (CURRENCY ":0.000010",
|
TALER_string_to_amount (CURRENCY ":0.000010",
|
||||||
&fee_closing));
|
&fee_closing));
|
||||||
now = GNUNET_TIME_absolute_get ();
|
now = GNUNET_TIME_timestamp_get ();
|
||||||
(void) GNUNET_TIME_round_abs (&now);
|
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||||
plugin->insert_reserve_closed (plugin->cls,
|
plugin->insert_reserve_closed (plugin->cls,
|
||||||
&reserve_pub,
|
&reserve_pub,
|
||||||
@ -1917,12 +1918,11 @@ run (void *cls)
|
|||||||
plugin->ensure_coin_known (plugin->cls,
|
plugin->ensure_coin_known (plugin->cls,
|
||||||
&deposit.coin));
|
&deposit.coin));
|
||||||
{
|
{
|
||||||
struct GNUNET_TIME_Absolute now;
|
struct GNUNET_TIME_Timestamp now;
|
||||||
struct GNUNET_TIME_Absolute r;
|
struct GNUNET_TIME_Timestamp r;
|
||||||
struct TALER_Amount deposit_fee;
|
struct TALER_Amount deposit_fee;
|
||||||
|
|
||||||
now = GNUNET_TIME_absolute_get ();
|
now = GNUNET_TIME_timestamp_get ();
|
||||||
GNUNET_TIME_round_abs (&now);
|
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||||
plugin->insert_deposit (plugin->cls,
|
plugin->insert_deposit (plugin->cls,
|
||||||
now,
|
now,
|
||||||
@ -1932,16 +1932,20 @@ run (void *cls)
|
|||||||
&deposit,
|
&deposit,
|
||||||
&deposit_fee,
|
&deposit_fee,
|
||||||
&r));
|
&r));
|
||||||
FAILIF (now.abs_value_us != r.abs_value_us);
|
FAILIF (GNUNET_TIME_timestamp_cmp (now,
|
||||||
|
!=,
|
||||||
|
r));
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
struct GNUNET_TIME_Absolute start_range;
|
struct GNUNET_TIME_Timestamp start_range;
|
||||||
struct GNUNET_TIME_Absolute end_range;
|
struct GNUNET_TIME_Timestamp end_range;
|
||||||
|
|
||||||
start_range = GNUNET_TIME_absolute_subtract (deadline,
|
start_range = GNUNET_TIME_absolute_to_timestamp (
|
||||||
GNUNET_TIME_UNIT_SECONDS);
|
GNUNET_TIME_absolute_subtract (deadline.abs_time,
|
||||||
end_range = GNUNET_TIME_absolute_add (deadline,
|
GNUNET_TIME_UNIT_SECONDS));
|
||||||
GNUNET_TIME_UNIT_SECONDS);
|
end_range = GNUNET_TIME_absolute_to_timestamp (
|
||||||
|
GNUNET_TIME_absolute_add (deadline.abs_time,
|
||||||
|
GNUNET_TIME_UNIT_SECONDS));
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||||
plugin->select_deposits_missing_wire (plugin->cls,
|
plugin->select_deposits_missing_wire (plugin->cls,
|
||||||
start_range,
|
start_range,
|
||||||
@ -2012,7 +2016,7 @@ run (void *cls)
|
|||||||
"test-2"));
|
"test-2"));
|
||||||
RND_BLK (&deposit2.merchant_pub); /* should fail if merchant is different */
|
RND_BLK (&deposit2.merchant_pub); /* should fail if merchant is different */
|
||||||
{
|
{
|
||||||
struct GNUNET_TIME_Absolute r;
|
struct GNUNET_TIME_Timestamp r;
|
||||||
struct TALER_Amount deposit_fee;
|
struct TALER_Amount deposit_fee;
|
||||||
|
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
|
||||||
@ -2140,11 +2144,15 @@ run (void *cls)
|
|||||||
FAILIF (0 !=
|
FAILIF (0 !=
|
||||||
GNUNET_memcmp (&have->wire_salt,
|
GNUNET_memcmp (&have->wire_salt,
|
||||||
&deposit.wire_salt));
|
&deposit.wire_salt));
|
||||||
FAILIF (have->timestamp.abs_value_us != deposit.timestamp.abs_value_us);
|
FAILIF (GNUNET_TIME_timestamp_cmp (have->timestamp,
|
||||||
FAILIF (have->refund_deadline.abs_value_us !=
|
!=,
|
||||||
deposit.refund_deadline.abs_value_us);
|
deposit.timestamp));
|
||||||
FAILIF (have->wire_deadline.abs_value_us !=
|
FAILIF (GNUNET_TIME_timestamp_cmp (have->refund_deadline,
|
||||||
deposit.wire_deadline.abs_value_us);
|
!=,
|
||||||
|
deposit.refund_deadline));
|
||||||
|
FAILIF (GNUNET_TIME_timestamp_cmp (have->wire_deadline,
|
||||||
|
!=,
|
||||||
|
deposit.wire_deadline));
|
||||||
FAILIF (0 != TALER_amount_cmp (&have->amount_with_fee,
|
FAILIF (0 != TALER_amount_cmp (&have->amount_with_fee,
|
||||||
&deposit.amount_with_fee));
|
&deposit.amount_with_fee));
|
||||||
FAILIF (0 != TALER_amount_cmp (&have->deposit_fee,
|
FAILIF (0 != TALER_amount_cmp (&have->deposit_fee,
|
||||||
|
Loading…
Reference in New Issue
Block a user