a first step towards normalizing the DB a bit and not storing data redundantly
This commit is contained in:
parent
0ccb420f4c
commit
54504b7f37
@ -609,7 +609,7 @@ run_test ()
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:1",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -621,7 +621,7 @@ run_test ()
|
||||
.label = "expect-deposit-1",
|
||||
.details.expect_transaction.debit_account = 3,
|
||||
.details.expect_transaction.credit_account = 4,
|
||||
.details.expect_transaction.amount = "EUR:1"
|
||||
.details.expect_transaction.amount = "EUR:0.9"
|
||||
},
|
||||
|
||||
{
|
||||
@ -648,7 +648,7 @@ run_test ()
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:1",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_DATABASE_DEPOSIT,
|
||||
@ -658,7 +658,7 @@ run_test ()
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:1",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -669,7 +669,7 @@ run_test ()
|
||||
.label = "expect-deposit-2",
|
||||
.details.expect_transaction.debit_account = 3,
|
||||
.details.expect_transaction.credit_account = 4,
|
||||
.details.expect_transaction.amount = "EUR:2"
|
||||
.details.expect_transaction.amount = "EUR:1.8"
|
||||
},
|
||||
|
||||
{
|
||||
@ -686,7 +686,7 @@ run_test ()
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:1",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_DATABASE_DEPOSIT,
|
||||
@ -696,7 +696,7 @@ run_test ()
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:1",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_DATABASE_DEPOSIT,
|
||||
@ -706,7 +706,7 @@ run_test ()
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:1",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -717,21 +717,21 @@ run_test ()
|
||||
.label = "expect-deposit-3a",
|
||||
.details.expect_transaction.debit_account = 3,
|
||||
.details.expect_transaction.credit_account = 4,
|
||||
.details.expect_transaction.amount = "EUR:1"
|
||||
.details.expect_transaction.amount = "EUR:0.9"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_EXPECT_TRANSACTION,
|
||||
.label = "expect-deposit-3b",
|
||||
.details.expect_transaction.debit_account = 3,
|
||||
.details.expect_transaction.credit_account = 4,
|
||||
.details.expect_transaction.amount = "EUR:1"
|
||||
.details.expect_transaction.amount = "EUR:0.9"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_EXPECT_TRANSACTION,
|
||||
.label = "expect-deposit-3c",
|
||||
.details.expect_transaction.debit_account = 3,
|
||||
.details.expect_transaction.credit_account = 5,
|
||||
.details.expect_transaction.amount = "EUR:1"
|
||||
.details.expect_transaction.amount = "EUR:0.9"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_EXPECT_TRANSACTIONS_EMPTY,
|
||||
@ -746,8 +746,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.01",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.2",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_DATABASE_DEPOSIT,
|
||||
@ -756,8 +756,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.01",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.2",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -781,7 +781,7 @@ run_test ()
|
||||
.label = "expect-deposit-4",
|
||||
.details.expect_transaction.debit_account = 3,
|
||||
.details.expect_transaction.credit_account = 4,
|
||||
.details.expect_transaction.amount = "EUR:0.02"
|
||||
.details.expect_transaction.amount = "EUR:0.2"
|
||||
},
|
||||
|
||||
/* test picking all deposits at earliest deadline */
|
||||
@ -792,8 +792,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 10 }, /* 10s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.01",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.2",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_DATABASE_DEPOSIT,
|
||||
@ -802,8 +802,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.01",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.2",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -827,7 +827,7 @@ run_test ()
|
||||
.label = "expect-deposit-5",
|
||||
.details.expect_transaction.debit_account = 3,
|
||||
.details.expect_transaction.credit_account = 4,
|
||||
.details.expect_transaction.amount = "EUR:0.02"
|
||||
.details.expect_transaction.amount = "EUR:0.2"
|
||||
},
|
||||
|
||||
/* Test NEVER running 'tiny' unless they make up minimum unit */
|
||||
@ -838,8 +838,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.002",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.102",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -856,8 +856,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.002",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.102",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_DATABASE_DEPOSIT,
|
||||
@ -866,8 +866,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.002",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.102",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -884,8 +884,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.002",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.102",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -902,8 +902,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.002",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.102",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -925,8 +925,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.009",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.109",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -943,8 +943,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.009",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.109",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -965,8 +965,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.022",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.122",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -988,8 +988,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.009",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.109",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -1006,8 +1006,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.009",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.109",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -1025,8 +1025,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.022",
|
||||
.details.deposit.deposit_fee = "EUR:0"
|
||||
.details.deposit.amount_with_fee = "EUR:0.122",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -1049,8 +1049,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.009",
|
||||
.details.deposit.deposit_fee = "EUR:0.001"
|
||||
.details.deposit.amount_with_fee = "EUR:0.104",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -1067,8 +1067,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 5 }, /* 5s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.009",
|
||||
.details.deposit.deposit_fee = "EUR:0.002"
|
||||
.details.deposit.amount_with_fee = "EUR:0.105",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
@ -1086,8 +1086,8 @@ run_test ()
|
||||
.details.deposit.merchant_account = 4,
|
||||
.details.deposit.transaction_id = 1,
|
||||
.details.deposit.wire_deadline = { 1000LL * 1000 * 0 }, /* 0s */
|
||||
.details.deposit.amount_with_fee = "EUR:0.022",
|
||||
.details.deposit.deposit_fee = "EUR:0.008"
|
||||
.details.deposit.amount_with_fee = "EUR:0.112",
|
||||
.details.deposit.deposit_fee = "EUR:0.1"
|
||||
},
|
||||
{
|
||||
.opcode = OPCODE_RUN_AGGREGATOR,
|
||||
|
@ -257,7 +257,7 @@ postgres_create_tables (void *cls)
|
||||
denominations keys. The denominations are to be referred to using
|
||||
foreign keys. */
|
||||
SQLEXEC ("CREATE TABLE IF NOT EXISTS denominations"
|
||||
"(pub BYTEA PRIMARY KEY"
|
||||
"(denom_pub BYTEA PRIMARY KEY"
|
||||
",master_pub BYTEA NOT NULL CHECK (LENGTH(master_pub)=32)"
|
||||
",master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)"
|
||||
",valid_from INT8 NOT NULL"
|
||||
@ -322,7 +322,7 @@ postgres_create_tables (void *cls)
|
||||
(as they really must be unique). */
|
||||
SQLEXEC ("CREATE TABLE IF NOT EXISTS reserves_out"
|
||||
"(h_blind_ev BYTEA PRIMARY KEY"
|
||||
",denom_pub BYTEA NOT NULL REFERENCES denominations (pub) ON DELETE CASCADE"
|
||||
",denom_pub BYTEA NOT NULL REFERENCES denominations (denom_pub) ON DELETE CASCADE"
|
||||
",denom_sig BYTEA NOT NULL"
|
||||
",reserve_pub BYTEA NOT NULL REFERENCES reserves (reserve_pub) ON DELETE CASCADE"
|
||||
",reserve_sig BYTEA NOT NULL CHECK (LENGTH(reserve_sig)=64)"
|
||||
@ -343,7 +343,7 @@ postgres_create_tables (void *cls)
|
||||
coin information only once. */
|
||||
SQLEXEC("CREATE TABLE IF NOT EXISTS known_coins "
|
||||
"(coin_pub BYTEA NOT NULL PRIMARY KEY CHECK (LENGTH(coin_pub)=32)"
|
||||
",denom_pub BYTEA NOT NULL REFERENCES denominations (pub) ON DELETE CASCADE"
|
||||
",denom_pub BYTEA NOT NULL REFERENCES denominations (denom_pub) ON DELETE CASCADE"
|
||||
",denom_sig BYTEA NOT NULL"
|
||||
")");
|
||||
/**
|
||||
@ -392,7 +392,7 @@ postgres_create_tables (void *cls)
|
||||
SQLEXEC("CREATE TABLE IF NOT EXISTS refresh_order "
|
||||
"(session_hash BYTEA NOT NULL REFERENCES refresh_sessions (session_hash) ON DELETE CASCADE"
|
||||
",newcoin_index INT2 NOT NULL "
|
||||
",denom_pub BYTEA NOT NULL REFERENCES denominations (pub) ON DELETE CASCADE"
|
||||
",denom_pub BYTEA NOT NULL REFERENCES denominations (denom_pub) ON DELETE CASCADE"
|
||||
",PRIMARY KEY (session_hash, newcoin_index)"
|
||||
")");
|
||||
|
||||
@ -437,9 +437,6 @@ postgres_create_tables (void *cls)
|
||||
",amount_with_fee_val INT8 NOT NULL"
|
||||
",amount_with_fee_frac INT4 NOT NULL"
|
||||
",amount_with_fee_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
||||
",deposit_fee_val INT8 NOT NULL"
|
||||
",deposit_fee_frac INT4 NOT NULL"
|
||||
",deposit_fee_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
||||
",timestamp INT8 NOT NULL"
|
||||
",refund_deadline INT8 NOT NULL"
|
||||
",wire_deadline INT8 NOT NULL"
|
||||
@ -529,7 +526,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
/* Used in #postgres_insert_denomination_info() */
|
||||
PREPARE ("denomination_insert",
|
||||
"INSERT INTO denominations "
|
||||
"(pub"
|
||||
"(denom_pub"
|
||||
",master_pub"
|
||||
",master_sig"
|
||||
",valid_from"
|
||||
@ -582,7 +579,7 @@ postgres_prepare (PGconn *db_conn)
|
||||
",fee_refund_frac"
|
||||
",fee_refund_curr" /* must match coin_curr */
|
||||
" FROM denominations"
|
||||
" WHERE pub=$1;",
|
||||
" WHERE denom_pub=$1;",
|
||||
1, NULL);
|
||||
|
||||
/* Used in #postgres_reserve_get() */
|
||||
@ -882,9 +879,6 @@ postgres_prepare (PGconn *db_conn)
|
||||
",amount_with_fee_val"
|
||||
",amount_with_fee_frac"
|
||||
",amount_with_fee_curr"
|
||||
",deposit_fee_val"
|
||||
",deposit_fee_frac"
|
||||
",deposit_fee_curr"
|
||||
",timestamp"
|
||||
",refund_deadline"
|
||||
",wire_deadline"
|
||||
@ -895,8 +889,8 @@ postgres_prepare (PGconn *db_conn)
|
||||
",wire"
|
||||
") VALUES "
|
||||
"($1, $2, $3, $4, $5, $6, $7, $8, $9, $10,"
|
||||
" $11, $12, $13, $14, $15, $16);",
|
||||
16, NULL);
|
||||
" $11, $12, $13);",
|
||||
13, NULL);
|
||||
|
||||
/* Used in #postgres_insert_refund() to store refund information */
|
||||
PREPARE ("insert_refund",
|
||||
@ -945,11 +939,13 @@ postgres_prepare (PGconn *db_conn)
|
||||
" amount_with_fee_val"
|
||||
",amount_with_fee_frac"
|
||||
",amount_with_fee_curr"
|
||||
",deposit_fee_val"
|
||||
",deposit_fee_frac"
|
||||
",deposit_fee_curr"
|
||||
",denom.fee_deposit_val"
|
||||
",denom.fee_deposit_frac"
|
||||
",denom.fee_deposit_curr"
|
||||
",wire_deadline"
|
||||
" FROM deposits"
|
||||
" JOIN known_coins kc USING (coin_pub)"
|
||||
" JOIN denominations denom USING (denom_pub)"
|
||||
" WHERE ("
|
||||
" (coin_pub=$1) AND"
|
||||
" (transaction_id=$2) AND"
|
||||
@ -966,9 +962,9 @@ postgres_prepare (PGconn *db_conn)
|
||||
",amount_with_fee_val"
|
||||
",amount_with_fee_frac"
|
||||
",amount_with_fee_curr"
|
||||
",deposit_fee_val"
|
||||
",deposit_fee_frac"
|
||||
",deposit_fee_curr"
|
||||
",denom.fee_deposit_val"
|
||||
",denom.fee_deposit_frac"
|
||||
",denom.fee_deposit_curr"
|
||||
",wire_deadline"
|
||||
",transaction_id"
|
||||
",h_contract"
|
||||
@ -976,6 +972,8 @@ postgres_prepare (PGconn *db_conn)
|
||||
",merchant_pub"
|
||||
",coin_pub"
|
||||
" FROM deposits"
|
||||
" JOIN known_coins kc USING (coin_pub)"
|
||||
" JOIN denominations denom USING (denom_pub)"
|
||||
" WHERE"
|
||||
" tiny=false AND"
|
||||
" done=false AND"
|
||||
@ -992,14 +990,16 @@ postgres_prepare (PGconn *db_conn)
|
||||
",amount_with_fee_val"
|
||||
",amount_with_fee_frac"
|
||||
",amount_with_fee_curr"
|
||||
",deposit_fee_val"
|
||||
",deposit_fee_frac"
|
||||
",deposit_fee_curr"
|
||||
",denom.fee_deposit_val"
|
||||
",denom.fee_deposit_frac"
|
||||
",denom.fee_deposit_curr"
|
||||
",wire_deadline"
|
||||
",transaction_id"
|
||||
",h_contract"
|
||||
",coin_pub"
|
||||
" FROM deposits"
|
||||
" JOIN known_coins kc USING (coin_pub)"
|
||||
" JOIN denominations denom USING (denom_pub)"
|
||||
" WHERE"
|
||||
" merchant_pub=$1 AND"
|
||||
" h_wire=$2 AND"
|
||||
@ -1041,9 +1041,9 @@ postgres_prepare (PGconn *db_conn)
|
||||
",amount_with_fee_val"
|
||||
",amount_with_fee_frac"
|
||||
",amount_with_fee_curr"
|
||||
",deposit_fee_val"
|
||||
",deposit_fee_frac"
|
||||
",deposit_fee_curr"
|
||||
",denom.fee_deposit_val"
|
||||
",denom.fee_deposit_frac"
|
||||
",denom.fee_deposit_curr"
|
||||
",timestamp"
|
||||
",refund_deadline"
|
||||
",merchant_pub"
|
||||
@ -1052,6 +1052,8 @@ postgres_prepare (PGconn *db_conn)
|
||||
",wire"
|
||||
",coin_sig"
|
||||
" FROM deposits"
|
||||
" JOIN known_coins kc USING (coin_pub)"
|
||||
" JOIN denominations denom USING (denom_pub)"
|
||||
" WHERE coin_pub=$1",
|
||||
1, NULL);
|
||||
|
||||
@ -2384,7 +2386,7 @@ postgres_get_ready_deposit (void *cls,
|
||||
&transaction_id),
|
||||
TALER_PQ_result_spec_amount ("amount_with_fee",
|
||||
&amount_with_fee),
|
||||
TALER_PQ_result_spec_amount ("deposit_fee",
|
||||
TALER_PQ_result_spec_amount ("fee_deposit",
|
||||
&deposit_fee),
|
||||
GNUNET_PQ_result_spec_absolute_time ("wire_deadline",
|
||||
&wire_deadline),
|
||||
@ -2489,7 +2491,7 @@ postgres_iterate_matching_deposits (void *cls,
|
||||
&transaction_id),
|
||||
TALER_PQ_result_spec_amount ("amount_with_fee",
|
||||
&amount_with_fee),
|
||||
TALER_PQ_result_spec_amount ("deposit_fee",
|
||||
TALER_PQ_result_spec_amount ("fee_deposit",
|
||||
&deposit_fee),
|
||||
GNUNET_PQ_result_spec_absolute_time ("wire_deadline",
|
||||
&wire_deadline),
|
||||
@ -2644,7 +2646,6 @@ postgres_insert_deposit (void *cls,
|
||||
GNUNET_PQ_query_param_auto_from_type (&deposit->coin.coin_pub),
|
||||
GNUNET_PQ_query_param_uint64 (&deposit->transaction_id),
|
||||
TALER_PQ_query_param_amount (&deposit->amount_with_fee),
|
||||
TALER_PQ_query_param_amount (&deposit->deposit_fee),
|
||||
GNUNET_PQ_query_param_absolute_time (&deposit->timestamp),
|
||||
GNUNET_PQ_query_param_absolute_time (&deposit->refund_deadline),
|
||||
GNUNET_PQ_query_param_absolute_time (&deposit->wire_deadline),
|
||||
@ -3635,7 +3636,7 @@ postgres_get_coin_transactions (void *cls,
|
||||
&deposit->transaction_id),
|
||||
TALER_PQ_result_spec_amount ("amount_with_fee",
|
||||
&deposit->amount_with_fee),
|
||||
TALER_PQ_result_spec_amount ("deposit_fee",
|
||||
TALER_PQ_result_spec_amount ("fee_deposit",
|
||||
&deposit->deposit_fee),
|
||||
GNUNET_PQ_result_spec_absolute_time ("timestamp",
|
||||
&deposit->timestamp),
|
||||
@ -4017,7 +4018,7 @@ postgres_wire_lookup_deposit_wtid (void *cls,
|
||||
struct TALER_Amount coin_fee;
|
||||
struct GNUNET_PQ_ResultSpec rs[] = {
|
||||
TALER_PQ_result_spec_amount ("amount_with_fee", &coin_amount),
|
||||
TALER_PQ_result_spec_amount ("deposit_fee", &coin_fee),
|
||||
TALER_PQ_result_spec_amount ("fee_deposit", &coin_fee),
|
||||
GNUNET_PQ_result_spec_absolute_time ("wire_deadline", &exec_time),
|
||||
GNUNET_PQ_result_spec_end
|
||||
};
|
||||
|
@ -1185,8 +1185,7 @@ run (void *cls)
|
||||
deposit.transaction_id =
|
||||
GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX);
|
||||
deposit.amount_with_fee = value;
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
TALER_amount_get_zero (CURRENCY, &deposit.deposit_fee));
|
||||
deposit.deposit_fee = fee_deposit;
|
||||
result = 8;
|
||||
FAILIF (GNUNET_OK !=
|
||||
plugin->insert_deposit (plugin->cls,
|
||||
@ -1381,7 +1380,7 @@ run (void *cls)
|
||||
memset (&merchant_pub_wt, 43, sizeof (merchant_pub_wt));
|
||||
memset (&h_wire_wt, 44, sizeof (h_wire_wt));
|
||||
memset (&h_contract_wt, 45, sizeof (h_contract_wt));
|
||||
memset (&coin_pub_wt, 46, sizeof (coin_pub_wt));
|
||||
coin_pub_wt = deposit.coin.coin_pub;
|
||||
transaction_id_wt = 47;
|
||||
execution_time_wt = GNUNET_TIME_absolute_get ();
|
||||
memset (&merchant_pub_wt, 48, sizeof (merchant_pub_wt));
|
||||
|
Loading…
Reference in New Issue
Block a user