Skip to content

Commit

Permalink
update tests and blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Jan 4, 2025
1 parent b61b717 commit 4e2027a
Show file tree
Hide file tree
Showing 30 changed files with 6,047 additions and 5,702 deletions.
4,797 changes: 2,435 additions & 2,362 deletions apiary.apib

Large diffs are not rendered by default.

119 changes: 104 additions & 15 deletions counterparty-core/counterpartycore/test/fixtures/api_v2_fixtures.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
"status": "valid",
"source": ADDR[0],
"destination": "72a62abedd38d5f667150929c24dc1d7465dd81ab1502974814d20c1f65d871f:0",
"destination_address": ADDR[0],
"asset": "XCP",
"quantity": 100,
"fee_paid": 0,
Expand All @@ -216,7 +217,7 @@
"block_index": DP["default_block_index"],
"command": "insert",
"category": "sends",
"bindings": '{"asset":"XCP","block_index":310704,"destination":"72a62abedd38d5f667150929c24dc1d7465dd81ab1502974814d20c1f65d871f:0","fee_paid":0,"msg_index":0,"quantity":100,"send_type":"attach","source":"mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc","status":"valid","tx_hash":"72a62abedd38d5f667150929c24dc1d7465dd81ab1502974814d20c1f65d871f","tx_index":705}',
"bindings": f'{{"asset":"XCP","block_index":310704,"destination":"72a62abedd38d5f667150929c24dc1d7465dd81ab1502974814d20c1f65d871f:0","destination_address":"{ADDR[0]}","fee_paid":0,"msg_index":0,"quantity":100,"send_type":"attach","source":"mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc","status":"valid","tx_hash":"72a62abedd38d5f667150929c24dc1d7465dd81ab1502974814d20c1f65d871f","tx_index":705}}',
"event": "ATTACH_TO_UTXO",
},
},
Expand Down Expand Up @@ -246,7 +247,7 @@
"block_index": DP["default_block_index"],
"command": "insert",
"category": "sends",
"bindings": '{"asset":"XCP","block_index":310704,"destination":"72a62abedd38d5f667150929c24dc1d7465dd81ab1502974814d20c1f65d871f:1","fee_paid":0,"msg_index":0,"quantity":100,"send_type":"attach","source":"mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc","status":"valid","tx_hash":"72a62abedd38d5f667150929c24dc1d7465dd81ab1502974814d20c1f65d871f","tx_index":705}',
"bindings": f'{{"asset":"XCP","block_index":310704,"destination":"72a62abedd38d5f667150929c24dc1d7465dd81ab1502974814d20c1f65d871f:1","destination_address":"{ADDR[0]}","fee_paid":0,"msg_index":0,"quantity":100,"send_type":"attach","source":"mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc","status":"valid","tx_hash":"72a62abedd38d5f667150929c24dc1d7465dd81ab1502974814d20c1f65d871f","tx_index":705}}',
"event": "ATTACH_TO_UTXO",
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"block_index": DP["default_block_index"],
"status": "valid",
"source": "52e45e01cbe79b442630303fac0372aaf6fbe102ff4dd07ca6be01ba8f3c41b4:0",
"source_address": ADDR[0],
"destination": ADDR[1],
"asset": "XCP",
"quantity": 100,
Expand Down Expand Up @@ -122,6 +123,7 @@
"block_index": DP["default_block_index"],
"status": "valid",
"source": "52e45e01cbe79b442630303fac0372aaf6fbe102ff4dd07ca6be01ba8f3c41b4:0",
"source_address": ADDR[0],
"destination": ADDR[0],
"asset": "XCP",
"quantity": 100,
Expand All @@ -137,6 +139,7 @@
"block_index": DP["default_block_index"],
"status": "valid",
"source": "ea0962df1a71c3d76e08ee80c7a24b2ea670e31639c39cd897fca3bc008e81a0:0",
"source_address": ADDR[0],
"destination": ADDR[0],
"asset": "DIVISIBLE",
"quantity": 1,
Expand Down Expand Up @@ -172,6 +175,7 @@
"block_index": DP["default_block_index"],
"status": "valid",
"source": "52e45e01cbe79b442630303fac0372aaf6fbe102ff4dd07ca6be01ba8f3c41b4:0",
"source_address": ADDR[0],
"destination": ADDR[1],
"asset": "XCP",
"quantity": 100,
Expand All @@ -187,6 +191,7 @@
"block_index": DP["default_block_index"],
"status": "valid",
"source": "ea0962df1a71c3d76e08ee80c7a24b2ea670e31639c39cd897fca3bc008e81a0:0",
"source_address": ADDR[0],
"destination": ADDR[1],
"asset": "DIVISIBLE",
"quantity": 1,
Expand Down Expand Up @@ -222,6 +227,7 @@
"block_index": DP["default_block_index"],
"status": "valid",
"source": "52e45e01cbe79b442630303fac0372aaf6fbe102ff4dd07ca6be01ba8f3c41b4:0",
"source_address": ADDR[0],
"destination": ADDR[0],
"asset": "XCP",
"quantity": 100,
Expand All @@ -237,6 +243,7 @@
"block_index": DP["default_block_index"],
"status": "valid",
"source": "ea0962df1a71c3d76e08ee80c7a24b2ea670e31639c39cd897fca3bc008e81a0:0",
"source_address": ADDR[0],
"destination": ADDR[0],
"asset": "DIVISIBLE",
"quantity": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
"block_index": 310703,
"command": "parse",
"category": "blocks",
"bindings": '{"block_index":310703,"ledger_hash":"d0c189136e77945fbd64c71ea8782aad1514f97719e6d5dd710a9ff4b89c5082","messages_hash":"b4844c7325b49c6d48ca0308711a94ee823daae54526430b883bf91b202e4c97","transaction_count":0,"txlist_hash":"afc33d89d102d0709a3678fd73866fca401ead694ea78c942219ed289fa3835b"}',
"bindings": '{"block_index":310703,"ledger_hash":"d0c189136e77945fbd64c71ea8782aad1514f97719e6d5dd710a9ff4b89c5082","messages_hash":"6e604c0d9be70560992e6f28e05bc1115cab883a7dc258b88b74e61c2d54c693","transaction_count":0,"txlist_hash":"afc33d89d102d0709a3678fd73866fca401ead694ea78c942219ed289fa3835b"}',
"timestamp": 0,
"event": "BLOCK_PARSED",
"tx_hash": None,
"event_hash": "de5e6b9dd4d54345241fa044910932b6dda1d6121b463b572088afc5d9ae7182",
"event_hash": "aa1e7a859eb6779d2b6b5d3921b054918dd92bccd35c3fa048f2915d65d44ac7",
},
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ..params import (
ADDR,
DP,
)

Expand Down Expand Up @@ -53,7 +54,9 @@
"block_index": DP["default_block_index"],
"status": "valid",
"source": UTXO_2,
"source_address": ADDR[0],
"destination": UTXO_3,
"destination_address": ADDR[0],
"asset": "XCP",
"quantity": 100,
"fee_paid": 0,
Expand Down Expand Up @@ -105,7 +108,9 @@
"block_index": DP["default_block_index"],
"status": "valid",
"source": UTXO_3,
"source_address": ADDR[0],
"destination": UTXO_1,
"destination_address": ADDR[0],
"asset": "DIVISIBLE",
"quantity": 1,
"fee_paid": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Initializing database...
Adding `send_type` column to sends table
Added `send_type` column to sends table in 0.00 seconds
Adding `send_type` column to `sends` table
Added `send_type` column to `sends` table in 0.00 seconds
Adding `source_address` and `destination_address` column to `sends` table
SQLITE_LOG: statement aborts at 2: [DROP TRIGGER IF EXISTS block_update_sends] database schema has changed (17) SQLITE_SCHEMA
SQLITE_LOG: statement aborts at 13: [CREATE TRIGGER IF NOT EXISTS block_update_sends
BEFORE UPDATE ON sends BEGIN
SELECT RAISE(FAIL, "UPDATES NOT ALLOWED");
END;] database schema ha (17) SQLITE_SCHEMA
Added `source_address` and `destination_address` column to `sends` table in 0.00 seconds
Fixing issuances `asset_events` field
Fixing issuances `asset_longname` field
SQLITE_LOG: statement aborts at 12: [SELECT value FROM config WHERE name = ?] database schema has changed (17) SQLITE_SCHEMA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1520,14 +1520,14 @@ CREATE TABLE "sends"(
asset TEXT,
quantity INTEGER,
status TEXT,
msg_index INTEGER DEFAULT 0, memo BLOB, fee_paid INTEGER DEFAULT 0, send_type TEXT,
msg_index INTEGER DEFAULT 0, memo BLOB, fee_paid INTEGER DEFAULT 0, send_type TEXT, source_address TEXT, destination_address TEXT,
PRIMARY KEY (tx_index, msg_index),
FOREIGN KEY (tx_index, tx_hash, block_index) REFERENCES transactions(tx_index, tx_hash, block_index),
UNIQUE (tx_hash, msg_index) ON CONFLICT FAIL);
INSERT INTO sends VALUES(2,'374cc56a03a48bd34fb24bf20c1158b68f45165d3cb992e718a96340953703a0',310001,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','1_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','XCP',50000000,'valid',0,NULL,0,'send');
INSERT INTO sends VALUES(8,'bdebd7acb157ada0d9acecb007f8baae88a5d170c42978a1bdb1f2783fa108e4',310007,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','1_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','BBBB',4000000,'valid',0,NULL,0,'send');
INSERT INTO sends VALUES(9,'5e948b20ea8e3a4bed6172565266b3049880df3d6a4782dd2457373c6970d7c7',310008,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','1_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','BBBC',526,'valid',0,NULL,0,'send');
INSERT INTO sends VALUES(24,'0223ff3b70a1a3e6a82bbb59eb5db6d191957aa45ae1d2118ef74cc160d44a75',310023,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','1_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','BBBC',10000,'valid',0,NULL,0,'send');
INSERT INTO sends VALUES(2,'374cc56a03a48bd34fb24bf20c1158b68f45165d3cb992e718a96340953703a0',310001,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','1_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','XCP',50000000,'valid',0,NULL,0,'send',NULL,NULL);
INSERT INTO sends VALUES(8,'bdebd7acb157ada0d9acecb007f8baae88a5d170c42978a1bdb1f2783fa108e4',310007,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','1_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','BBBB',4000000,'valid',0,NULL,0,'send',NULL,NULL);
INSERT INTO sends VALUES(9,'5e948b20ea8e3a4bed6172565266b3049880df3d6a4782dd2457373c6970d7c7',310008,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','1_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','BBBC',526,'valid',0,NULL,0,'send',NULL,NULL);
INSERT INTO sends VALUES(24,'0223ff3b70a1a3e6a82bbb59eb5db6d191957aa45ae1d2118ef74cc160d44a75',310023,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','1_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_2','BBBC',10000,'valid',0,NULL,0,'send',NULL,NULL);
-- Triggers and indices on sends
CREATE TRIGGER block_update_sends
BEFORE UPDATE ON sends BEGIN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Initializing database...
Adding `send_type` column to sends table
Added `send_type` column to sends table in 0.00 seconds
Adding `send_type` column to `sends` table
Added `send_type` column to `sends` table in 0.00 seconds
Adding `source_address` and `destination_address` column to `sends` table
SQLITE_LOG: statement aborts at 2: [DROP TRIGGER IF EXISTS block_update_sends] database schema has changed (17) SQLITE_SCHEMA
SQLITE_LOG: statement aborts at 13: [CREATE TRIGGER IF NOT EXISTS block_update_sends
BEFORE UPDATE ON sends BEGIN
SELECT RAISE(FAIL, "UPDATES NOT ALLOWED");
END;] database schema ha (17) SQLITE_SCHEMA
Added `source_address` and `destination_address` column to `sends` table in 0.00 seconds
Fixing issuances `asset_events` field
Fixing issuances `asset_longname` field
SQLITE_LOG: statement aborts at 12: [SELECT value FROM config WHERE name = ?] database schema has changed (17) SQLITE_SCHEMA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1520,14 +1520,14 @@ CREATE TABLE "sends"(
asset TEXT,
quantity INTEGER,
status TEXT,
msg_index INTEGER DEFAULT 0, memo BLOB, fee_paid INTEGER DEFAULT 0, send_type TEXT,
msg_index INTEGER DEFAULT 0, memo BLOB, fee_paid INTEGER DEFAULT 0, send_type TEXT, source_address TEXT, destination_address TEXT,
PRIMARY KEY (tx_index, msg_index),
FOREIGN KEY (tx_index, tx_hash, block_index) REFERENCES transactions(tx_index, tx_hash, block_index),
UNIQUE (tx_hash, msg_index) ON CONFLICT FAIL);
INSERT INTO sends VALUES(2,'8a6c8cf39cf51b8993783d69c86fefe891ad4e664aa338b071f385baac18d166',310001,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_3','1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mqPCfvqTfYctXMUfmniXeG2nyaN8w6tPmj_3','XCP',50000000,'valid',0,NULL,0,'send');
INSERT INTO sends VALUES(8,'b90742692d5fc29e135aba33fc5a5a0b762c45beb2468db4722df2984352d935',310007,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_3','1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mqPCfvqTfYctXMUfmniXeG2nyaN8w6tPmj_3','BBBB',4000000,'valid',0,NULL,0,'send');
INSERT INTO sends VALUES(9,'395496521d524b4220d2094684c4a1a000452ed47c23d26abb447ed8e23f1905',310008,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_3','1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mqPCfvqTfYctXMUfmniXeG2nyaN8w6tPmj_3','BBBC',526,'valid',0,NULL,0,'send');
INSERT INTO sends VALUES(24,'7300352646df906a09ee31075a6a26b7f81ca1a5804ead10cb2d6ad20b017667',310023,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_3','1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mqPCfvqTfYctXMUfmniXeG2nyaN8w6tPmj_3','BBBC',10000,'valid',0,NULL,0,'send');
INSERT INTO sends VALUES(2,'8a6c8cf39cf51b8993783d69c86fefe891ad4e664aa338b071f385baac18d166',310001,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_3','1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mqPCfvqTfYctXMUfmniXeG2nyaN8w6tPmj_3','XCP',50000000,'valid',0,NULL,0,'send',NULL,NULL);
INSERT INTO sends VALUES(8,'b90742692d5fc29e135aba33fc5a5a0b762c45beb2468db4722df2984352d935',310007,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_3','1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mqPCfvqTfYctXMUfmniXeG2nyaN8w6tPmj_3','BBBB',4000000,'valid',0,NULL,0,'send',NULL,NULL);
INSERT INTO sends VALUES(9,'395496521d524b4220d2094684c4a1a000452ed47c23d26abb447ed8e23f1905',310008,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_3','1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mqPCfvqTfYctXMUfmniXeG2nyaN8w6tPmj_3','BBBC',526,'valid',0,NULL,0,'send',NULL,NULL);
INSERT INTO sends VALUES(24,'7300352646df906a09ee31075a6a26b7f81ca1a5804ead10cb2d6ad20b017667',310023,'1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mtQheFaSfWELRB2MyMBaiWjdDm6ux9Ezns_3','1_mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc_mnfAHmddVibnZNSkh8DvKaQoiEfNsxjXzH_mqPCfvqTfYctXMUfmniXeG2nyaN8w6tPmj_3','BBBC',10000,'valid',0,NULL,0,'send',NULL,NULL);
-- Triggers and indices on sends
CREATE TRIGGER block_update_sends
BEFORE UPDATE ON sends BEGIN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Initializing database...
Adding `send_type` column to sends table
Added `send_type` column to sends table in 0.00 seconds
Adding `send_type` column to `sends` table
Added `send_type` column to `sends` table in 0.00 seconds
Adding `source_address` and `destination_address` column to `sends` table
SQLITE_LOG: statement aborts at 2: [DROP TRIGGER IF EXISTS block_update_sends] database schema has changed (17) SQLITE_SCHEMA
SQLITE_LOG: statement aborts at 13: [CREATE TRIGGER IF NOT EXISTS block_update_sends
BEFORE UPDATE ON sends BEGIN
SELECT RAISE(FAIL, "UPDATES NOT ALLOWED");
END;] database schema ha (17) SQLITE_SCHEMA
Added `source_address` and `destination_address` column to `sends` table in 0.00 seconds
Fixing issuances `asset_events` field
Fixing issuances `asset_longname` field
SQLITE_LOG: statement aborts at 12: [SELECT value FROM config WHERE name = ?] database schema has changed (17) SQLITE_SCHEMA
Expand Down
Loading

0 comments on commit 4e2027a

Please sign in to comment.