From 620f814268fcec5ff1d258b061a18c1b4e21df84 Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Wed, 3 Jan 2024 01:17:04 -0800 Subject: [PATCH 01/12] Add script to forward transactions an check database results --- .../mint_redeem_decompress.scenario | 3 + .../mint_redeem_decompress_asset.txt | 29 ++++ .../mint_redeem_decompress_cl_items.txt | 18 +++ .../mint_transfer_burn.scenario | 3 + .../mint_transfer_burn_asset.txt | 29 ++++ .../mint_transfer_burn_cl_items.txt | 18 +++ .../run-bubblegum-sequences.sh | 136 ++++++++++++++++++ 7 files changed, 236 insertions(+) create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress.scenario create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_cl_items.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_transfer_burn.scenario create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_cl_items.txt create mode 100755 tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress.scenario b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress.scenario new file mode 100644 index 000000000..b9e801be6 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress.scenario @@ -0,0 +1,3 @@ +4DBsuEnL1sZgEV7AHYeD8wsuKKhhNnZPgDKrzLxQXDhizdPRWvfKJp6e8f3uTdhA9wGCkdMxPBCpwqXnTQdrCcqv +4Qvu5MAaACFKmPmFndTBBzVP6wPvBKdraaG7tRaQMQeSzL499x3AMuH1bmyPn6YFpQ5ZKMjmB8ybQNPBS8qeebXc +2EeCLqYKWRggMurkSWh7Co7W5BJs6uyZ7ierA2BW3q8CpejWYdv8mbDARmNYbnSuFsF8s2EAw8T8pgnMZW1EanVd \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset.txt new file mode 100644 index 000000000..aab332368 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset.txt @@ -0,0 +1,29 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \x4582ef313005487b924213937300a3c5cef8502646c8c182a2a9e1188adb196b +alt_id | +specification_version | v1 +specification_asset_class | NFT +owner | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | \x4582ef313005487b924213937300a3c5cef8502646c8c182a2a9e1188adb196b +compressed | f +compressible | f +seq | 0 +tree_id | +leaf | +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | \x4582ef313005487b924213937300a3c5cef8502646c8c182a2a9e1188adb196b +created_at | +burnt | f +slot_updated | 224069842 +data_hash | +creator_hash | +owner_delegate_seq | 1 +leaf_seq | +base_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_cl_items.txt new file mode 100644 index 000000000..6367b022f --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_cl_items.txt @@ -0,0 +1,18 @@ + tree | node_idx | leaf_idx | seq | level | hash +--------------------------------------------------------------------+----------+----------+-----+-------+-------------------------------------------------------------------- + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 16384 | 0 | 2 | 0 | \x0000000000000000000000000000000000000000000000000000000000000000 + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 8192 | | 2 | 1 | \xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5 + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 4096 | | 2 | 2 | \xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30 + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 2048 | | 2 | 3 | \x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85 + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 1024 | | 2 | 4 | \xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344 + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 512 | | 2 | 5 | \x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 256 | | 2 | 6 | \x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968 + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 128 | | 2 | 7 | \xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83 + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 64 | | 2 | 8 | \x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 32 | | 2 | 9 | \xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0 + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 16 | | 2 | 10 | \xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5 + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 8 | | 2 | 11 | \xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892 + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 4 | | 2 | 12 | \x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 2 | | 2 | 13 | \xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb + \x85de015db25b997c2c2dc80baa680016bf82c1d748a1c69361a54daee5c4e561 | 1 | | 2 | 14 | \x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc +(15 rows) \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn.scenario b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn.scenario new file mode 100644 index 000000000..d304aec94 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn.scenario @@ -0,0 +1,3 @@ +5coWPFty37s7haT3SVyMf6PkTaABEnhCRhfDjXeMNS58czHB5dCFPY6VrsZNwxBnqypmNic1LbLp1j5qjbdnZAc8 +k6jmJcurgBQ6F2bVa86Z1vGb7ievzxwRZ8GAqzFEG8HicDizxceYPUm1KTzWZ3QKtGgy1EuFWUGCRqBeKU9SAoJ +KHNhLijkAMeKeKm6kpbk3go6q9uMF3zmfCoYSBgERe8qJDW8q5ANpnkyBuyVkychXCeWzRY8i5EtKfeGaDDU23w \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset.txt new file mode 100644 index 000000000..101dead1b --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset.txt @@ -0,0 +1,29 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \x75d2c89f62f8a50ed994309655bbd27de2c5f0b3da4cf8c329320016b47aa3d1 +alt_id | +specification_version | v1 +specification_asset_class | NFT +owner | \x98f51858ebca2d4fbe5a791f8ac3be5247af748d4e10c82ca22dfcfc6a17ad80 +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | +compressed | t +compressible | f +seq | 3 +tree_id | \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c +leaf | \x32c1a03c769943e075b2767a0ed09ea6f0a93f096f03f1498da795634f63c6f6 +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | \x75d2c89f62f8a50ed994309655bbd27de2c5f0b3da4cf8c329320016b47aa3d1 +created_at | +burnt | t +slot_updated | 221559431 +data_hash | GFsq2BCwZdQaErGkQD5my36tpC8Cg38HFuMvbM6ShC2h +creator_hash | 2ct1dcDUbFDHfpdtuZ5vdkPB1ewjFg9pxRi58Yj4huCj +owner_delegate_seq | 2 +leaf_seq | 2 +base_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_cl_items.txt new file mode 100644 index 000000000..8bea6e8a1 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_cl_items.txt @@ -0,0 +1,18 @@ + tree | node_idx | leaf_idx | seq | level | hash +--------------------------------------------------------------------+----------+----------+-----+-------+-------------------------------------------------------------------- + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 16384 | 0 | 3 | 0 | \x0000000000000000000000000000000000000000000000000000000000000000 + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 8192 | | 3 | 1 | \xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5 + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 4096 | | 3 | 2 | \xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30 + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 2048 | | 3 | 3 | \x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85 + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 1024 | | 3 | 4 | \xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344 + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 512 | | 3 | 5 | \x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 256 | | 3 | 6 | \x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968 + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 128 | | 3 | 7 | \xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83 + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 64 | | 3 | 8 | \x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 32 | | 3 | 9 | \xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0 + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 16 | | 3 | 10 | \xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5 + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 8 | | 3 | 11 | \xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892 + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 4 | | 3 | 12 | \x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 2 | | 3 | 13 | \xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb + \xaf03fe8e86529fb13bdd87e100da8fd5e3cba075941c4cd7f8f747db7b25532c | 1 | | 3 | 14 | \x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc +(15 rows) \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh new file mode 100755 index 000000000..3a8982a17 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh @@ -0,0 +1,136 @@ +#!/bin/bash + +# Output colors. +RED() { echo $'\e[1;31m'$1$'\e[0m'; } +GRN() { echo $'\e[1;32m'$1$'\e[0m'; } + +SCENARIOS=("mint_transfer_burn.scenario" \ +"mint_redeem_decompress.scenario" +) +EXPECTED_ASSET_VALUES=("mint_transfer_burn_asset.txt" \ +"mint_redeem_decompress_asset.txt" +) +EXPECTED_CL_ITEMS_VALUES=("mint_transfer_burn_cl_items.txt" +"mint_redeem_decompress_cl_items.txt" +) + +if [ ${#SCENARIOS[@]} -gt 0 ]; then + echo "Running ${#SCENARIOS[@]} scenarios" +else + echo "NO SCENARIOS FOUND!" + exit 1 +fi + +# 0 is pass, 1 is fail. +STATUS=0 + +# Run each scenario and check for expected database result. +for i in ${!SCENARIOS[@]}; do + + # Initially this asset should not be in `asset`` table. + if [ -f "${EXPECTED_ASSET_VALUES[$i]}" ]; then + EXPECTED_ASSET_VALUE=$(<"${EXPECTED_ASSET_VALUES[$i]}") + ASSET_ID=$(echo "$EXPECTED_ASSET_VALUE" | grep -oP '^(?!tree_id).*id\s+\|\s+\K[^ ]+') + if [ ${#ASSET_ID} -ne 66 ]; then + echo $(RED "${SCENARIOS[$i]} incorrect asset ID parsing") + STATUS=1 + continue + fi + + SQL="select * from asset where id = '$ASSET_ID';" + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") + + if [ "(0 rows)" == "$DATABASE_VAL" ]; then + echo $(GRN "${SCENARIOS[$i]} initial asset table passed") + else + echo $(RED "${SCENARIOS[$i]} initial asset table failed") + STATUS=1 + fi + fi + + # Initially this tree should not be in `cl_items`` table. + if [ -f "${EXPECTED_CL_ITEMS_VALUES[$i]}" ]; then + EXPECTED_CL_ITEMS=$(<"${EXPECTED_CL_ITEMS_VALUES[$i]}") + TREE_ID=$(echo "$EXPECTED_CL_ITEMS" | grep -oP '^\s*\K\\x[0-9a-f]+' | head -n 1) + if [ ${#TREE_ID} -ne 66 ]; then + echo $(RED "${SCENARIOS[$i]} incorrect asset ID parsing") + STATUS=1 + continue + fi + + SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") + + if [ "(0 rows)" == "$DATABASE_VAL" ]; then + echo $(GRN "${SCENARIOS[$i]} initial cl_items table passed") + else + echo $(RED "${SCENARIOS[$i]} initial cl_items table failed") + STATUS=1 + fi + fi + + # Run the scenario that indexes the asset. + (cd .. && \ + cargo run -- \ + --redis-url 'redis://localhost/' \ + --rpc-url 'https://api.devnet.solana.com' \ + scenario \ + --scenario-file "bubblegum_tests/${SCENARIOS[$i]}" \ + 2>&1 | grep -v "Group already exists: BUSYGROUP: Consumer Group name already exists") + + sleep 5 + + # Asset should now be in `asset`` table and all fields except `created_at` date match. + if [ -f "${EXPECTED_ASSET_VALUES[$i]}" ]; then + SQL="select * from asset where id = '$ASSET_ID';" + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") + DATABASE_VAL_NO_DATE=$(echo "$DATABASE_VAL" | sed -E 's/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9.]+\+[0-9]{2}//g') + + echo "expected asset value" + echo "$EXPECTED_ASSET_VALUE" + echo "then asset ID" + echo "$ASSET_ID" + echo "SQL" + echo "$SQL" + echo "Database val no date" + echo "$DATABASE_VAL_NO_DATE" + + if [ "$EXPECTED_ASSET_VALUE" == "$DATABASE_VAL_NO_DATE" ]; then + echo $(GRN "${SCENARIOS[$i]} asset table passed") + else + echo $(RED "${SCENARIOS[$i]} asset table failed") + STATUS=1 + fi + fi + + # Tree should now be in `cl_items`` table and all fields match. + if [ -f "${EXPECTED_CL_ITEMS_VALUES[$i]}" ]; then + SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana --command="$SQL") + + # echo "expected cl_items" + # echo "$EXPECTED_CL_ITEMS" + # echo "then tree ID" + # echo "$TREE_ID" + # echo "SQL" + # echo "$SQL" + # echo "Database val" + # echo "$DATABASE_VAL" + + if [ "$EXPECTED_CL_ITEMS" == "$DATABASE_VAL" ]; then + echo $(GRN "${SCENARIOS[$i]} cl_items table passed") + else + echo $(RED "${SCENARIOS[$i]} cl_items table failed") + STATUS=1 + fi + fi +done + +echo "" +if [ $STATUS -eq 1 ]; then + echo $(RED "SOME TESTS FAILED!") +else + echo $(GRN "ALL TESTS PASSED!") +fi + +exit $STATUS From 272105816da4128c4aa9f055b8dcf76c362695f3 Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Wed, 3 Jan 2024 11:17:06 -0800 Subject: [PATCH 02/12] Fix ordering and add debug info --- .../mint_redeem_decompress.scenario | 2 +- .../mint_redeem_decompress_asset.txt | 1 - .../mint_transfer_burn.scenario | 2 +- .../mint_transfer_burn_asset.txt | 1 - .../run-bubblegum-sequences.sh | 58 +++++++++---------- 5 files changed, 31 insertions(+), 33 deletions(-) diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress.scenario b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress.scenario index b9e801be6..111eed691 100644 --- a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress.scenario +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress.scenario @@ -1,3 +1,3 @@ 4DBsuEnL1sZgEV7AHYeD8wsuKKhhNnZPgDKrzLxQXDhizdPRWvfKJp6e8f3uTdhA9wGCkdMxPBCpwqXnTQdrCcqv 4Qvu5MAaACFKmPmFndTBBzVP6wPvBKdraaG7tRaQMQeSzL499x3AMuH1bmyPn6YFpQ5ZKMjmB8ybQNPBS8qeebXc -2EeCLqYKWRggMurkSWh7Co7W5BJs6uyZ7ierA2BW3q8CpejWYdv8mbDARmNYbnSuFsF8s2EAw8T8pgnMZW1EanVd \ No newline at end of file +2EeCLqYKWRggMurkSWh7Co7W5BJs6uyZ7ierA2BW3q8CpejWYdv8mbDARmNYbnSuFsF8s2EAw8T8pgnMZW1EanVd diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset.txt index aab332368..3218c44f8 100644 --- a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset.txt +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset.txt @@ -19,7 +19,6 @@ royalty_target_type | creators royalty_target | royalty_amount | 0 asset_data | \x4582ef313005487b924213937300a3c5cef8502646c8c182a2a9e1188adb196b -created_at | burnt | f slot_updated | 224069842 data_hash | diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn.scenario b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn.scenario index d304aec94..0ef217664 100644 --- a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn.scenario +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn.scenario @@ -1,3 +1,3 @@ 5coWPFty37s7haT3SVyMf6PkTaABEnhCRhfDjXeMNS58czHB5dCFPY6VrsZNwxBnqypmNic1LbLp1j5qjbdnZAc8 k6jmJcurgBQ6F2bVa86Z1vGb7ievzxwRZ8GAqzFEG8HicDizxceYPUm1KTzWZ3QKtGgy1EuFWUGCRqBeKU9SAoJ -KHNhLijkAMeKeKm6kpbk3go6q9uMF3zmfCoYSBgERe8qJDW8q5ANpnkyBuyVkychXCeWzRY8i5EtKfeGaDDU23w \ No newline at end of file +KHNhLijkAMeKeKm6kpbk3go6q9uMF3zmfCoYSBgERe8qJDW8q5ANpnkyBuyVkychXCeWzRY8i5EtKfeGaDDU23w diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset.txt index 101dead1b..71b09ea4c 100644 --- a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset.txt +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset.txt @@ -19,7 +19,6 @@ royalty_target_type | creators royalty_target | royalty_amount | 0 asset_data | \x75d2c89f62f8a50ed994309655bbd27de2c5f0b3da4cf8c329320016b47aa3d1 -created_at | burnt | t slot_updated | 221559431 data_hash | GFsq2BCwZdQaErGkQD5my36tpC8Cg38HFuMvbM6ShC2h diff --git a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh index 3a8982a17..a16d4ac58 100755 --- a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh +++ b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh @@ -69,36 +69,37 @@ for i in ${!SCENARIOS[@]}; do fi fi - # Run the scenario that indexes the asset. - (cd .. && \ - cargo run -- \ - --redis-url 'redis://localhost/' \ - --rpc-url 'https://api.devnet.solana.com' \ - scenario \ - --scenario-file "bubblegum_tests/${SCENARIOS[$i]}" \ - 2>&1 | grep -v "Group already exists: BUSYGROUP: Consumer Group name already exists") - + # Run the scenario file that indexes the asset. These are done with separate calls to the `txn_forwarder` + # in order to enforce order. Just calling the `txn_forwarder` with the file results in random ordering. + readarray -t TXS < "${SCENARIOS[$i]}" + + for TX in ${TXS[@]}; do + (cd .. && \ + cargo run -- \ + --redis-url 'redis://localhost/' \ + --rpc-url 'https://api.devnet.solana.com' \ + single \ + --txn "$TX" \ + 2>&1 | grep -v "Group already exists: BUSYGROUP: Consumer Group name already exists") + done + sleep 5 # Asset should now be in `asset`` table and all fields except `created_at` date match. if [ -f "${EXPECTED_ASSET_VALUES[$i]}" ]; then SQL="select * from asset where id = '$ASSET_ID';" DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") - DATABASE_VAL_NO_DATE=$(echo "$DATABASE_VAL" | sed -E 's/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9.]+\+[0-9]{2}//g') - - echo "expected asset value" - echo "$EXPECTED_ASSET_VALUE" - echo "then asset ID" - echo "$ASSET_ID" - echo "SQL" - echo "$SQL" - echo "Database val no date" - echo "$DATABASE_VAL_NO_DATE" - + DATABASE_VAL_NO_DATE=$(sed '/^created_at/d' <<< "$DATABASE_VAL") + if [ "$EXPECTED_ASSET_VALUE" == "$DATABASE_VAL_NO_DATE" ]; then echo $(GRN "${SCENARIOS[$i]} asset table passed") else echo $(RED "${SCENARIOS[$i]} asset table failed") + echo "Asset ID: $ASSET_ID" + echo "Expected:" + echo "$EXPECTED_ASSET_VALUE" + echo "Actual:" + echo "$DATABASE_VAL_NO_DATE" STATUS=1 fi fi @@ -108,22 +109,21 @@ for i in ${!SCENARIOS[@]}; do SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana --command="$SQL") - # echo "expected cl_items" - # echo "$EXPECTED_CL_ITEMS" - # echo "then tree ID" - # echo "$TREE_ID" - # echo "SQL" - # echo "$SQL" - # echo "Database val" - # echo "$DATABASE_VAL" - if [ "$EXPECTED_CL_ITEMS" == "$DATABASE_VAL" ]; then echo $(GRN "${SCENARIOS[$i]} cl_items table passed") else echo $(RED "${SCENARIOS[$i]} cl_items table failed") + echo "Tree ID: $TREE_ID" + echo "Expected:" + echo "$EXPECTED_CL_ITEMS" + echo "Actual:" + echo "$DATABASE_VAL" + STATUS=1 fi fi + + echo "" done echo "" From f5850b65c935ae3d550503c25622b0a8c7efc36f Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Wed, 3 Jan 2024 11:48:34 -0800 Subject: [PATCH 03/12] Add remaining non-creator/non-collection tests --- .../mint_delegate_transfer.scenario | 3 ++ .../mint_delegate_transfer_asset.txt | 28 +++++++++++++++++++ .../mint_delegate_transfer_cl_items.txt | 18 ++++++++++++ ...m_cancel_redeem_redeem_decompress.scenario | 5 ++++ ..._cancel_redeem_redeem_decompress_asset.txt | 28 +++++++++++++++++++ ...ncel_redeem_redeem_decompress_cl_items.txt | 18 ++++++++++++ .../mint_transfer_transfer.scenario | 3 ++ .../mint_transfer_transfer_asset.txt | 28 +++++++++++++++++++ .../mint_transfer_transfer_cl_items.txt | 18 ++++++++++++ .../run-bubblegum-sequences.sh | 17 ++++++++--- 10 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer.scenario create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_cl_items.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress.scenario create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_cl_items.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer.scenario create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer.scenario b/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer.scenario new file mode 100644 index 000000000..0a1c8b6a8 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer.scenario @@ -0,0 +1,3 @@ +KNWsAYPo3mm1HuFxRyEwBBMUZ2hqTnFXjoPVFo7WxGTfmfRwz6K8eERc4dnJpHyuoDkAZu1czK55iB1SbtCsdW2 +3B1sASkuToCWuGFRG47axQDm1SpgLi8qDDGnRFeR7LB6oa5C3ZmkEuX98373gdMTBXED44FkwT227kBBAGSw7e8M +5Q8TAMMkMTHEM2BHyD2fp2sVdYKByFeATzM2mHF6Xbbar33WaeuygPKGYCWiDEt3MZU1mUrq1ePnT9o4Pa318p8w diff --git a/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset.txt new file mode 100644 index 000000000..3d0d3cd1e --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset.txt @@ -0,0 +1,28 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \x5aed3f1d3faf9f5f4664f98055d25627d59d0351ee8f0802ebbb33ccd8220d67 +alt_id | +specification_version | v1 +specification_asset_class | NFT +owner | \xbd44aea35a84cb4ef1a03d3f66896abab67932a7fb812d6f583ef4099f59843a +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | +compressed | t +compressible | f +seq | 3 +tree_id | \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c +leaf | \xa23d2bea8c65587f7f9fc627e3799ad8ffd0e222ccfda60e4327e07c51b8be3e +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | \x5aed3f1d3faf9f5f4664f98055d25627d59d0351ee8f0802ebbb33ccd8220d67 +burnt | f +slot_updated | 226274127 +data_hash | F5iDDHxd2DVZa5eZCqE2a91QLadea4ygJwM18UUut6dj +creator_hash | EF57j46BT5Cynwija675rq59iDN1ZapYsJDnMHqta463 +owner_delegate_seq | 3 +leaf_seq | 3 +base_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_cl_items.txt new file mode 100644 index 000000000..5414959ca --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_cl_items.txt @@ -0,0 +1,18 @@ + tree | node_idx | leaf_idx | seq | level | hash +--------------------------------------------------------------------+----------+----------+-----+-------+-------------------------------------------------------------------- + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 16384 | 0 | 3 | 0 | \xa23d2bea8c65587f7f9fc627e3799ad8ffd0e222ccfda60e4327e07c51b8be3e + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 8192 | | 3 | 1 | \xe9152e451cbd119ea3bab38afbf6b4711199c73fdb385e44b06c2e707f8ca243 + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 4096 | | 3 | 2 | \x111573f71f36e611641839e7e560bb73b680309841360c514965d168a4389a51 + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 2048 | | 3 | 3 | \x4f64ec2a0d08484ec567cc0b4060dbfbceb9fa665d8a17dc8af9ebece7f01d9b + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 1024 | | 3 | 4 | \x4989debb3a21bd71c16a74d766abbd699650ee1aeae315fdda79a1728746da95 + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 512 | | 3 | 5 | \x418f8841080e45b9b7cf09a3caaefd42976708bf0257c6c0806bb16ead54cf53 + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 256 | | 3 | 6 | \xd4935ac4cb16da1b52198a0dac6d2609c14430ef5212809e294652ec25d9ef59 + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 128 | | 3 | 7 | \xd26ec1beefbb64d05cc4c976c617485d82c240033e94e747129975b40638e111 + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 64 | | 3 | 8 | \x3542d0fba80dd3681e3933f0ecd2ebd344a0ad96f23c8f2574099c7318c533e7 + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 32 | | 3 | 9 | \x9d39b564f68ed8b88e6357f64e5cd0c82ca6d534aa2dab975d9666c8f56725d5 + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 16 | | 3 | 10 | \x36d934448197c94e7d45f0863811edc196ed987620c41227e9f6ef1035c5934b + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 8 | | 3 | 11 | \x4637695dc219619cf5226f28ab04cb718f1140377ad01a5fff4fcd0fe2623be5 + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 4 | | 3 | 12 | \x12374d301a2a513f3b23b3645c1c1c7789bf8c9c15ef80caf9cf46351dc53dcb + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 2 | | 3 | 13 | \x4e9fe09b7aa626a863a95c6b9808a2c63ec6cc685993bd43a0b1a347c18d920f + \x1163033de45ffcf58694abca011d79e5c3682c00c65caf710490650c151b7c4c | 1 | | 3 | 14 | \x5f6a8668430a4bc94b280cdbba44efeb8847d9654ff034ffc1f537a66c120fb1 +(15 rows) \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress.scenario b/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress.scenario new file mode 100644 index 000000000..c9ddfd90e --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress.scenario @@ -0,0 +1,5 @@ +3uzWoVgLGVd9cGXaF3JW7znpWgKse3obCa2Vvdoe59kaziX84mEXTwecUoZ49PkJDjReRMSXksKzyfj7pf3ekAGR +49bJ8U3cK9htmLvA1mhXXcjKdpV2YN5JQBrb3Quh7wxENz1BP9F8fE9CKsje41aMbZwzgomnkXirKx2Xpdvprtak +32FpSe6r9jnFNjjvbx2PPQdZqs5KpMoF6yawiRW1F6ctu1kmx2B4sLDBGjsthVQtmnhaJVrqdtmUP893FwXCbqY5 +3HqVaL9xgroAVYehnrk98dju4Ck3v8TqB4nfwnFCaNWKueaAVZcB3841jv5km1KpnubbUDoJAGv4ZMeLfAmdN18f +3s3EN8gTthjjSXq5aV6imtBB58DQ1UGLch9dyzaACid4tAEDvqcEXoE3ibiAqxTaR5XSAArzPHgXtFM6FWvN7oDr diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset.txt new file mode 100644 index 000000000..339fcbb80 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset.txt @@ -0,0 +1,28 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \x4302561a2799244936a3b020569bf90f58cd9b406af4cd084a82a2cf6415a8f0 +alt_id | +specification_version | v1 +specification_asset_class | NFT +owner | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | \x4302561a2799244936a3b020569bf90f58cd9b406af4cd084a82a2cf6415a8f0 +compressed | f +compressible | f +seq | 0 +tree_id | +leaf | +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | \x4302561a2799244936a3b020569bf90f58cd9b406af4cd084a82a2cf6415a8f0 +burnt | f +slot_updated | 224494461 +data_hash | +creator_hash | +owner_delegate_seq | 3 +leaf_seq | +base_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_cl_items.txt new file mode 100644 index 000000000..d200b2ec8 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_cl_items.txt @@ -0,0 +1,18 @@ + tree | node_idx | leaf_idx | seq | level | hash +--------------------------------------------------------------------+----------+----------+-----+-------+-------------------------------------------------------------------- + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 16384 | 0 | 4 | 0 | \x0000000000000000000000000000000000000000000000000000000000000000 + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 8192 | | 4 | 1 | \xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5 + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 4096 | | 4 | 2 | \xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30 + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 2048 | | 4 | 3 | \x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85 + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 1024 | | 4 | 4 | \xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344 + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 512 | | 4 | 5 | \x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 256 | | 4 | 6 | \x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968 + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 128 | | 4 | 7 | \xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83 + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 64 | | 4 | 8 | \x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 32 | | 4 | 9 | \xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0 + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 16 | | 4 | 10 | \xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5 + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 8 | | 4 | 11 | \xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892 + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 4 | | 4 | 12 | \x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 2 | | 4 | 13 | \xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb + \xf8bf1069ff226eb41797417535cc5510ec75ffd006155dbda2371b5fee88bf7d | 1 | | 4 | 14 | \x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc +(15 rows) \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer.scenario b/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer.scenario new file mode 100644 index 000000000..ffcf676a4 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer.scenario @@ -0,0 +1,3 @@ +5bq936UgGs4RnxM78iXp1PwVhr8sTYoEsHCWpr8QBFtc2YtS3ieYHcsPG46G2ikwrS3tXYnUK93PzseT52AR81RR +5VC3Jqr5X1N8NB8zuSahHpayekLVozYkDiPjJLqU6H5M6fq9ExVLGYYKKCPbeksMPXTjy65sdEQGPzDWAYPs8QjP +34xjcNf3rZFKz381hKpFLqxpojaDgXEpCqH5qcpTXLaJnDbtqRz35wiuMF1cAgvJGLzYYrwaMvCK1D7LxYsdpMU1 diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset.txt new file mode 100644 index 000000000..ae5441231 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset.txt @@ -0,0 +1,28 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \xca35c69cd4d5bb853a93e4e76526be26cf5951982653cf653d9dddac5e5ac797 +alt_id | +specification_version | v1 +specification_asset_class | NFT +owner | \x6f8ed9b39d43793a5371d49634f9299098c7a8de514bf052598e4fc3303b19af +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | +compressed | t +compressible | f +seq | 3 +tree_id | \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 +leaf | \x45912e7b9afad71c6095cdda1383a8c49bc3283f5bdb35bbfc411e4ca44a8f7d +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | \xca35c69cd4d5bb853a93e4e76526be26cf5951982653cf653d9dddac5e5ac797 +burnt | f +slot_updated | 224501105 +data_hash | 68ZcMZF52Bv3mayj4AjPFdVoMhrE9Ap18CQRuUhB2pWu +creator_hash | 2RsQnw2DXTrKWT2GAd7LEnvgHuL8gZ8C2wk89dcW31yb +owner_delegate_seq | 3 +leaf_seq | 3 +base_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_cl_items.txt new file mode 100644 index 000000000..3bce5b5a9 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_cl_items.txt @@ -0,0 +1,18 @@ + tree | node_idx | leaf_idx | seq | level | hash +--------------------------------------------------------------------+----------+----------+-----+-------+-------------------------------------------------------------------- + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 16384 | 0 | 3 | 0 | \x45912e7b9afad71c6095cdda1383a8c49bc3283f5bdb35bbfc411e4ca44a8f7d + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 8192 | | 3 | 1 | \xd801cca361f2a89de3378a9a2aa13a1fa35d592ffcba4898cf29ad349cb49127 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 4096 | | 3 | 2 | \x8f9213e54cc7cdc05550c636db2636d7208f553b4e4e3ac18536e3957bf116b7 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 2048 | | 3 | 3 | \x5753eae6594777fbd7559f87ada77dc9d8d0ab1e7af9210122310bd181a3f2b3 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 1024 | | 3 | 4 | \x9456b1fb4ecba0a6463ab6b3cb0903f46fc81c2bc26f963aea4736dee78f32bc + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 512 | | 3 | 5 | \x436352dbb7b693f62518a507761229a8eccbc16cc4c045edba7d7c0dc5812dc9 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 256 | | 3 | 6 | \xfdfc08110a0934b10ecd0abfe7d5e3e9a376a814ae13606df63a1f575b1b09e4 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 128 | | 3 | 7 | \x11e6008ee0ba4beee8583c2b1657822cdcd5ea247a91110da38ee871d6706039 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 64 | | 3 | 8 | \x41bdd22b61376b15eb09f7448e82c06f60e9555360517f8204c97065b62f23c8 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 32 | | 3 | 9 | \x1292b3d58d066207d7574635c2296ffa0cfec8cdbf740695ad53864f1df041d3 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 16 | | 3 | 10 | \x639701cdaf796e69a292ca73c23e34ea390b4e54b3e5c9a0eb8fe5ed59a61e07 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 8 | | 3 | 11 | \x40779dc87591eaf7ee59002d73c8bef5daa4c6d87b70dbeeacebf59e8fa10d35 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 4 | | 3 | 12 | \xcadcb3afb2bdc362f845f8b733e0da6975335ff3ddbd182609a5bcb935990510 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 2 | | 3 | 13 | \xf4d64147487fb8e1a4a2537ca86c4d9fd3612d824950b007bdd36acb9ffda324 + \x8f072ea46368429371d5f51dd048498a14998fc9bed718cdab5e281a325c0023 | 1 | | 3 | 14 | \x2e32f5af4f4c051605810841aa7ee61008581d0d6f719a08a8bc9a4e9f79e6c7 +(15 rows) \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh index a16d4ac58..a05fc8cb1 100755 --- a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh +++ b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh @@ -6,12 +6,21 @@ GRN() { echo $'\e[1;32m'$1$'\e[0m'; } SCENARIOS=("mint_transfer_burn.scenario" \ "mint_redeem_decompress.scenario" +"mint_redeem_cancel_redeem_redeem_decompress.scenario" \ +"mint_transfer_transfer.scenario" \ +"mint_delegate_transfer.scenario" ) EXPECTED_ASSET_VALUES=("mint_transfer_burn_asset.txt" \ -"mint_redeem_decompress_asset.txt" +"mint_redeem_decompress_asset.txt" \ +"mint_redeem_cancel_redeem_redeem_decompress_asset.txt" \ +"mint_transfer_transfer_asset.txt" \ +"mint_delegate_transfer_asset.txt" ) -EXPECTED_CL_ITEMS_VALUES=("mint_transfer_burn_cl_items.txt" -"mint_redeem_decompress_cl_items.txt" +EXPECTED_CL_ITEMS_VALUES=("mint_transfer_burn_cl_items.txt" \ +"mint_redeem_decompress_cl_items.txt" \ +"mint_redeem_cancel_redeem_redeem_decompress_cl_items.txt" \ +"mint_transfer_transfer_cl_items.txt" \ +"mint_delegate_transfer_cl_items.txt" ) if [ ${#SCENARIOS[@]} -gt 0 ]; then @@ -83,7 +92,7 @@ for i in ${!SCENARIOS[@]}; do 2>&1 | grep -v "Group already exists: BUSYGROUP: Consumer Group name already exists") done - sleep 5 + sleep 3 # Asset should now be in `asset`` table and all fields except `created_at` date match. if [ -f "${EXPECTED_ASSET_VALUES[$i]}" ]; then From 43475a8ad72bee98774e48b2424a1c8905f8c16c Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:20:56 -0800 Subject: [PATCH 04/12] Require asset and cl_items files to exist --- .../run-bubblegum-sequences.sh | 155 +++++++++--------- 1 file changed, 75 insertions(+), 80 deletions(-) diff --git a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh index a05fc8cb1..2749e65a1 100755 --- a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh +++ b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh @@ -10,18 +10,6 @@ SCENARIOS=("mint_transfer_burn.scenario" \ "mint_transfer_transfer.scenario" \ "mint_delegate_transfer.scenario" ) -EXPECTED_ASSET_VALUES=("mint_transfer_burn_asset.txt" \ -"mint_redeem_decompress_asset.txt" \ -"mint_redeem_cancel_redeem_redeem_decompress_asset.txt" \ -"mint_transfer_transfer_asset.txt" \ -"mint_delegate_transfer_asset.txt" -) -EXPECTED_CL_ITEMS_VALUES=("mint_transfer_burn_cl_items.txt" \ -"mint_redeem_decompress_cl_items.txt" \ -"mint_redeem_cancel_redeem_redeem_decompress_cl_items.txt" \ -"mint_transfer_transfer_cl_items.txt" \ -"mint_delegate_transfer_cl_items.txt" -) if [ ${#SCENARIOS[@]} -gt 0 ]; then echo "Running ${#SCENARIOS[@]} scenarios" @@ -35,47 +23,60 @@ STATUS=0 # Run each scenario and check for expected database result. for i in ${!SCENARIOS[@]}; do + # Read in the `asset` file for this scenario. + EXPECTED_ASSET_FILE="$(basename "${SCENARIOS[$i]}" .scenario)_asset.txt" + if [ ! -f "$EXPECTED_ASSET_FILE" ]; then + echo $(RED "${SCENARIOS[$i]} missing asset file") + STATUS=1 + continue + fi + EXPECTED_ASSET_VALUE=$(<"$EXPECTED_ASSET_FILE") + + # Parse out the asset ID. + ASSET_ID=$(echo "$EXPECTED_ASSET_VALUE" | grep -oP '^(?!tree_id).*id\s+\|\s+\K[^ ]+') + if [ ${#ASSET_ID} -ne 66 ]; then + echo $(RED "${SCENARIOS[$i]} incorrect asset ID parsing") + echo "Asset ID: $ASSET_ID" + STATUS=1 + continue + fi # Initially this asset should not be in `asset`` table. - if [ -f "${EXPECTED_ASSET_VALUES[$i]}" ]; then - EXPECTED_ASSET_VALUE=$(<"${EXPECTED_ASSET_VALUES[$i]}") - ASSET_ID=$(echo "$EXPECTED_ASSET_VALUE" | grep -oP '^(?!tree_id).*id\s+\|\s+\K[^ ]+') - if [ ${#ASSET_ID} -ne 66 ]; then - echo $(RED "${SCENARIOS[$i]} incorrect asset ID parsing") - STATUS=1 - continue - fi - - SQL="select * from asset where id = '$ASSET_ID';" - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") - - if [ "(0 rows)" == "$DATABASE_VAL" ]; then - echo $(GRN "${SCENARIOS[$i]} initial asset table passed") - else - echo $(RED "${SCENARIOS[$i]} initial asset table failed") - STATUS=1 - fi + SQL="select * from asset where id = '$ASSET_ID';" + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") + if [ "(0 rows)" == "$DATABASE_VAL" ]; then + echo $(GRN "${SCENARIOS[$i]} initial asset table passed") + else + echo $(RED "${SCENARIOS[$i]} initial asset table failed") + STATUS=1 + fi + + # Read in the `cl_items` file for this scenario. + EXPECTED_CL_ITEMS_FILE="$(basename "${SCENARIOS[$i]}" .scenario)_cl_items.txt" + if [ ! -f "$EXPECTED_CL_ITEMS_FILE" ]; then + echo $(RED "${SCENARIOS[$i]} missing cl_items file") + STATUS=1 + continue + fi + EXPECTED_CL_ITEMS=$(<"$EXPECTED_CL_ITEMS_FILE") + + # Parse out the tree ID. + TREE_ID=$(echo "$EXPECTED_CL_ITEMS" | grep -oP '^\s*\K\\x[0-9a-f]+' | head -n 1) + if [ ${#TREE_ID} -ne 66 ]; then + echo $(RED "${SCENARIOS[$i]} incorrect asset ID parsing") + echo "Tree ID: $TREE_ID" + STATUS=1 + continue fi # Initially this tree should not be in `cl_items`` table. - if [ -f "${EXPECTED_CL_ITEMS_VALUES[$i]}" ]; then - EXPECTED_CL_ITEMS=$(<"${EXPECTED_CL_ITEMS_VALUES[$i]}") - TREE_ID=$(echo "$EXPECTED_CL_ITEMS" | grep -oP '^\s*\K\\x[0-9a-f]+' | head -n 1) - if [ ${#TREE_ID} -ne 66 ]; then - echo $(RED "${SCENARIOS[$i]} incorrect asset ID parsing") - STATUS=1 - continue - fi - - SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") - - if [ "(0 rows)" == "$DATABASE_VAL" ]; then - echo $(GRN "${SCENARIOS[$i]} initial cl_items table passed") - else - echo $(RED "${SCENARIOS[$i]} initial cl_items table failed") - STATUS=1 - fi + SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") + if [ "(0 rows)" == "$DATABASE_VAL" ]; then + echo $(GRN "${SCENARIOS[$i]} initial cl_items table passed") + else + echo $(RED "${SCENARIOS[$i]} initial cl_items table failed") + STATUS=1 fi # Run the scenario file that indexes the asset. These are done with separate calls to the `txn_forwarder` @@ -95,41 +96,35 @@ for i in ${!SCENARIOS[@]}; do sleep 3 # Asset should now be in `asset`` table and all fields except `created_at` date match. - if [ -f "${EXPECTED_ASSET_VALUES[$i]}" ]; then - SQL="select * from asset where id = '$ASSET_ID';" - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") - DATABASE_VAL_NO_DATE=$(sed '/^created_at/d' <<< "$DATABASE_VAL") - - if [ "$EXPECTED_ASSET_VALUE" == "$DATABASE_VAL_NO_DATE" ]; then - echo $(GRN "${SCENARIOS[$i]} asset table passed") - else - echo $(RED "${SCENARIOS[$i]} asset table failed") - echo "Asset ID: $ASSET_ID" - echo "Expected:" - echo "$EXPECTED_ASSET_VALUE" - echo "Actual:" - echo "$DATABASE_VAL_NO_DATE" - STATUS=1 - fi + SQL="select * from asset where id = '$ASSET_ID';" + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") + DATABASE_VAL_NO_DATE=$(sed '/^created_at/d' <<< "$DATABASE_VAL") + if [ "$EXPECTED_ASSET_VALUE" == "$DATABASE_VAL_NO_DATE" ]; then + echo $(GRN "${SCENARIOS[$i]} asset table passed") + else + echo $(RED "${SCENARIOS[$i]} asset table failed") + echo "Asset ID: $ASSET_ID" + echo "Expected:" + echo "$EXPECTED_ASSET_VALUE" + echo "Actual:" + echo "$DATABASE_VAL_NO_DATE" + STATUS=1 fi # Tree should now be in `cl_items`` table and all fields match. - if [ -f "${EXPECTED_CL_ITEMS_VALUES[$i]}" ]; then - SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana --command="$SQL") - - if [ "$EXPECTED_CL_ITEMS" == "$DATABASE_VAL" ]; then - echo $(GRN "${SCENARIOS[$i]} cl_items table passed") - else - echo $(RED "${SCENARIOS[$i]} cl_items table failed") - echo "Tree ID: $TREE_ID" - echo "Expected:" - echo "$EXPECTED_CL_ITEMS" - echo "Actual:" - echo "$DATABASE_VAL" - - STATUS=1 - fi + SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana --command="$SQL") + if [ "$EXPECTED_CL_ITEMS" == "$DATABASE_VAL" ]; then + echo $(GRN "${SCENARIOS[$i]} cl_items table passed") + else + echo $(RED "${SCENARIOS[$i]} cl_items table failed") + echo "Tree ID: $TREE_ID" + echo "Expected:" + echo "$EXPECTED_CL_ITEMS" + echo "Actual:" + echo "$DATABASE_VAL" + + STATUS=1 fi echo "" From c0b11ff9073cb427b8af9a6bcf007f947af3114f Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Wed, 3 Jan 2024 14:07:25 -0800 Subject: [PATCH 05/12] Add asset_creators and asset_grouping tests --- .../mint_delegate_transfer_asset_creators.txt | 16 ++++ .../mint_delegate_transfer_asset_grouping.txt | 8 ++ ...edeem_redeem_decompress_asset_creators.txt | 16 ++++ ...edeem_redeem_decompress_asset_grouping.txt | 8 ++ .../mint_redeem_decompress_asset_creators.txt | 16 ++++ .../mint_redeem_decompress_asset_grouping.txt | 8 ++ .../mint_transfer_burn_asset_creators.txt | 16 ++++ .../mint_transfer_burn_asset_grouping.txt | 8 ++ .../mint_transfer_transfer_asset_creators.txt | 16 ++++ .../mint_transfer_transfer_asset_grouping.txt | 8 ++ .../run-bubblegum-sequences.sh | 80 +++++++++++++++++-- 11 files changed, 195 insertions(+), 5 deletions(-) create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_creators.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_grouping.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_creators.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_grouping.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_creators.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_grouping.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_creators.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_grouping.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_creators.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_grouping.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_creators.txt new file mode 100644 index 000000000..6e62570fa --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_creators.txt @@ -0,0 +1,16 @@ +-[ RECORD 1 ]+------------------------------------------------------------------- +asset_id | \x5aed3f1d3faf9f5f4664f98055d25627d59d0351ee8f0802ebbb33ccd8220d67 +creator | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +share | 55 +verified | f +seq | 1 +slot_updated | 226274127 +position | 0 +-[ RECORD 2 ]+------------------------------------------------------------------- +asset_id | \x5aed3f1d3faf9f5f4664f98055d25627d59d0351ee8f0802ebbb33ccd8220d67 +creator | \xe3dc3480d88f714c38827aada3064e8d212a91e3fdb67f22438c1ed89318a0e5 +share | 45 +verified | f +seq | 1 +slot_updated | 226274127 +position | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_grouping.txt new file mode 100644 index 000000000..4b0e51667 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_grouping.txt @@ -0,0 +1,8 @@ +-[ RECORD 1 ]--+------------------------------------------------------------------- +asset_id | \x5aed3f1d3faf9f5f4664f98055d25627d59d0351ee8f0802ebbb33ccd8220d67 +group_key | collection +group_value | +seq | +slot_updated | 226274127 +verified | f +group_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_creators.txt new file mode 100644 index 000000000..a4e23a106 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_creators.txt @@ -0,0 +1,16 @@ +-[ RECORD 1 ]+------------------------------------------------------------------- +asset_id | \x4302561a2799244936a3b020569bf90f58cd9b406af4cd084a82a2cf6415a8f0 +creator | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +share | 55 +verified | f +seq | 1 +slot_updated | 224494461 +position | 0 +-[ RECORD 2 ]+------------------------------------------------------------------- +asset_id | \x4302561a2799244936a3b020569bf90f58cd9b406af4cd084a82a2cf6415a8f0 +creator | \xe6cd5c15dc19a877bc4bdf888a32145bd007f3a6ad52243937ffe41e3c2e7c3e +share | 45 +verified | f +seq | 1 +slot_updated | 224494461 +position | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_grouping.txt new file mode 100644 index 000000000..c59e77739 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_grouping.txt @@ -0,0 +1,8 @@ +-[ RECORD 1 ]--+------------------------------------------------------------------- +asset_id | \x4302561a2799244936a3b020569bf90f58cd9b406af4cd084a82a2cf6415a8f0 +group_key | collection +group_value | +seq | +slot_updated | 224494461 +verified | f +group_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_creators.txt new file mode 100644 index 000000000..6e2798b0f --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_creators.txt @@ -0,0 +1,16 @@ +-[ RECORD 1 ]+------------------------------------------------------------------- +asset_id | \x4582ef313005487b924213937300a3c5cef8502646c8c182a2a9e1188adb196b +creator | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +share | 55 +verified | f +seq | 1 +slot_updated | 224069842 +position | 0 +-[ RECORD 2 ]+------------------------------------------------------------------- +asset_id | \x4582ef313005487b924213937300a3c5cef8502646c8c182a2a9e1188adb196b +creator | \xfcd064cd56ad840b463ca2ee1f6e13b6181cbb7464699dbfe18fe989e71def89 +share | 45 +verified | f +seq | 1 +slot_updated | 224069842 +position | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_grouping.txt new file mode 100644 index 000000000..0a8de5453 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_grouping.txt @@ -0,0 +1,8 @@ +-[ RECORD 1 ]--+------------------------------------------------------------------- +asset_id | \x4582ef313005487b924213937300a3c5cef8502646c8c182a2a9e1188adb196b +group_key | collection +group_value | +seq | +slot_updated | 224069842 +verified | f +group_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_creators.txt new file mode 100644 index 000000000..5a372fa30 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_creators.txt @@ -0,0 +1,16 @@ +-[ RECORD 1 ]+------------------------------------------------------------------- +asset_id | \x75d2c89f62f8a50ed994309655bbd27de2c5f0b3da4cf8c329320016b47aa3d1 +creator | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +share | 55 +verified | f +seq | 1 +slot_updated | 221559431 +position | 0 +-[ RECORD 2 ]+------------------------------------------------------------------- +asset_id | \x75d2c89f62f8a50ed994309655bbd27de2c5f0b3da4cf8c329320016b47aa3d1 +creator | \xab4ea130077985e7bae2df6a4aa90c94a2918c7bec1ccf44ab994c6803f5e8d2 +share | 45 +verified | f +seq | 1 +slot_updated | 221559431 +position | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_grouping.txt new file mode 100644 index 000000000..528b49831 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_grouping.txt @@ -0,0 +1,8 @@ +-[ RECORD 1 ]--+------------------------------------------------------------------- +asset_id | \x75d2c89f62f8a50ed994309655bbd27de2c5f0b3da4cf8c329320016b47aa3d1 +group_key | collection +group_value | +seq | +slot_updated | 221559431 +verified | f +group_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_creators.txt new file mode 100644 index 000000000..35a05174a --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_creators.txt @@ -0,0 +1,16 @@ +-[ RECORD 1 ]+------------------------------------------------------------------- +asset_id | \xca35c69cd4d5bb853a93e4e76526be26cf5951982653cf653d9dddac5e5ac797 +creator | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +share | 55 +verified | f +seq | 1 +slot_updated | 224501105 +position | 0 +-[ RECORD 2 ]+------------------------------------------------------------------- +asset_id | \xca35c69cd4d5bb853a93e4e76526be26cf5951982653cf653d9dddac5e5ac797 +creator | \x900de0b94569cfed833ae4c2ca61ba796f44334823c57a58be5661585fd8f2e2 +share | 45 +verified | f +seq | 1 +slot_updated | 224501105 +position | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_grouping.txt new file mode 100644 index 000000000..e3aeb62ff --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_grouping.txt @@ -0,0 +1,8 @@ +-[ RECORD 1 ]--+------------------------------------------------------------------- +asset_id | \xca35c69cd4d5bb853a93e4e76526be26cf5951982653cf653d9dddac5e5ac797 +group_key | collection +group_value | +seq | +slot_updated | 224501105 +verified | f +group_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh index 2749e65a1..a15342360 100755 --- a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh +++ b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh @@ -42,8 +42,8 @@ for i in ${!SCENARIOS[@]}; do fi # Initially this asset should not be in `asset`` table. - SQL="select * from asset where id = '$ASSET_ID';" - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") + ASSET_SQL="SELECT * FROM asset WHERE id = '$ASSET_ID';" + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_SQL") if [ "(0 rows)" == "$DATABASE_VAL" ]; then echo $(GRN "${SCENARIOS[$i]} initial asset table passed") else @@ -51,6 +51,49 @@ for i in ${!SCENARIOS[@]}; do STATUS=1 fi + # Read in the `asset_creators` file for this scenario. + EXPECTED_ASSET_CREATORS_FILE="$(basename "${SCENARIOS[$i]}" .scenario)_asset_creators.txt" + if [ ! -f "$EXPECTED_ASSET_CREATORS_FILE" ]; then + echo $(RED "${SCENARIOS[$i]} missing asset_creators file") + STATUS=1 + continue + fi + EXPECTED_ASSET_CREATORS=$(<"$EXPECTED_ASSET_CREATORS_FILE") + + # Initially this asset should not be in `asset_creators`` table. + ASSET_CREATORS_SQL="SELECT asset_id, creator, share, verified, seq, slot_updated, position \ + FROM asset_creators \ + WHERE asset_id = '$ASSET_ID' \ + ORDER BY position;" + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_CREATORS_SQL") + if [ "(0 rows)" == "$DATABASE_VAL" ]; then + echo $(GRN "${SCENARIOS[$i]} initial asset_creators table passed") + else + echo $(RED "${SCENARIOS[$i]} initial asset_creators table failed") + STATUS=1 + fi + + # Read in the `asset_grouping` file for this scenario. + EXPECTED_ASSET_GROUPING_FILE="$(basename "${SCENARIOS[$i]}" .scenario)_asset_grouping.txt" + if [ ! -f "$EXPECTED_ASSET_GROUPING_FILE" ]; then + echo $(RED "${SCENARIOS[$i]} missing asset_grouping file") + STATUS=1 + continue + fi + EXPECTED_ASSET_GROUPING=$(<"$EXPECTED_ASSET_GROUPING_FILE") + + # Initially this asset should not be in `asset_grouping`` table. + ASSET_GROUPING_SQL="SELECT asset_id, group_key, group_value, seq, slot_updated, verified, group_info_seq \ + FROM asset_grouping \ + WHERE asset_id = '$ASSET_ID';" + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_GROUPING_SQL") + if [ "(0 rows)" == "$DATABASE_VAL" ]; then + echo $(GRN "${SCENARIOS[$i]} initial asset_grouping table passed") + else + echo $(RED "${SCENARIOS[$i]} initial asset_grouping table failed") + STATUS=1 + fi + # Read in the `cl_items` file for this scenario. EXPECTED_CL_ITEMS_FILE="$(basename "${SCENARIOS[$i]}" .scenario)_cl_items.txt" if [ ! -f "$EXPECTED_CL_ITEMS_FILE" ]; then @@ -95,9 +138,8 @@ for i in ${!SCENARIOS[@]}; do sleep 3 - # Asset should now be in `asset`` table and all fields except `created_at` date match. - SQL="select * from asset where id = '$ASSET_ID';" - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") + # Asset should now be in `asset` table and all fields except `created_at` date match. + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_SQL") DATABASE_VAL_NO_DATE=$(sed '/^created_at/d' <<< "$DATABASE_VAL") if [ "$EXPECTED_ASSET_VALUE" == "$DATABASE_VAL_NO_DATE" ]; then echo $(GRN "${SCENARIOS[$i]} asset table passed") @@ -111,6 +153,34 @@ for i in ${!SCENARIOS[@]}; do STATUS=1 fi + # Asset should now be in `asset_creators` table and all fields match. + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_CREATORS_SQL") + if [ "$EXPECTED_ASSET_CREATORS" == "$DATABASE_VAL" ]; then + echo $(GRN "${SCENARIOS[$i]} asset_creators table passed") + else + echo $(RED "${SCENARIOS[$i]} asset_creators table failed") + echo "Asset ID: $ASSET_ID" + echo "Expected:" + echo "$EXPECTED_ASSET_CREATORS" + echo "Actual:" + echo "$DATABASE_VAL" + STATUS=1 + fi + + # Asset should now be in `asset_grouping` table and all fields match. + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_GROUPING_SQL") + if [ "$EXPECTED_ASSET_GROUPING" == "$DATABASE_VAL" ]; then + echo $(GRN "${SCENARIOS[$i]} asset_grouping table passed") + else + echo $(RED "${SCENARIOS[$i]} asset_grouping table failed") + echo "Asset ID: $ASSET_ID" + echo "Expected:" + echo "$EXPECTED_ASSET_GROUPING" + echo "Actual:" + echo "$DATABASE_VAL" + STATUS=1 + fi + # Tree should now be in `cl_items`` table and all fields match. SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana --command="$SQL") From 9dfc8294448987dd6fa2956420ef32618c1a13ee Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Wed, 3 Jan 2024 14:28:13 -0800 Subject: [PATCH 06/12] Add verify_creator and verify_collection tests --- .../mint_verify_collection.scenario | 2 ++ .../mint_verify_collection_asset.txt | 28 +++++++++++++++++++ .../mint_verify_collection_asset_creators.txt | 16 +++++++++++ .../mint_verify_collection_asset_grouping.txt | 8 ++++++ .../mint_verify_collection_cl_items.txt | 18 ++++++++++++ .../mint_verify_creator.scenario | 2 ++ .../mint_verify_creator_asset.txt | 28 +++++++++++++++++++ .../mint_verify_creator_asset_creators.txt | 16 +++++++++++ .../mint_verify_creator_asset_grouping.txt | 8 ++++++ .../mint_verify_creator_cl_items.txt | 18 ++++++++++++ .../run-bubblegum-sequences.sh | 4 ++- 11 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_collection.scenario create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_creators.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_grouping.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_collection_cl_items.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_creator.scenario create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_creators.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_grouping.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_creator_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection.scenario b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection.scenario new file mode 100644 index 000000000..3824000ce --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection.scenario @@ -0,0 +1,2 @@ +5Az2Ts9mXesVk5spzS6myopV5BFn2dnTVX3ooKtbNJDXqhku9tuQ5ELX9xBeTH93ceoDoAtiWfcFTVdxdKAGSRp9 +5PadSM5ENNsqgb9dTdG728mCeciYg9QTbzm7WGwjJaxFeenVE4xzmi2tjKrswojJDBcJe2z8bx43A6tGyEsu9WTJ diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset.txt new file mode 100644 index 000000000..d26b30315 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset.txt @@ -0,0 +1,28 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \x03b8abdca02da73970dd4e2ba783224108acff30f31db83c40d5638ce67fc102 +alt_id | +specification_version | v1 +specification_asset_class | NFT +owner | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | +compressed | t +compressible | f +seq | 2 +tree_id | \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 +leaf | \x869e0d7e57274e1a00964a751dfc885f583b768ffbbe8f33b1bb8c945b0fe115 +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | \x03b8abdca02da73970dd4e2ba783224108acff30f31db83c40d5638ce67fc102 +burnt | f +slot_updated | 227661765 +data_hash | 8KQ45EBtVc6WrT4m4Zh52pRP27ZnvHbw4wrnx5nSBsVu +creator_hash | GJCkiiVATMT4o8n5Tv8bE5eFXo5DdTkZhRspfxigp8ZB +owner_delegate_seq | 1 +leaf_seq | 2 +base_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_creators.txt new file mode 100644 index 000000000..34d202fbb --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_creators.txt @@ -0,0 +1,16 @@ +-[ RECORD 1 ]+------------------------------------------------------------------- +asset_id | \x03b8abdca02da73970dd4e2ba783224108acff30f31db83c40d5638ce67fc102 +creator | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +share | 55 +verified | f +seq | 1 +slot_updated | 227661765 +position | 0 +-[ RECORD 2 ]+------------------------------------------------------------------- +asset_id | \x03b8abdca02da73970dd4e2ba783224108acff30f31db83c40d5638ce67fc102 +creator | \x5f081d909d1e178f2219c808d4b8fa24f22cac66eef92714f880bca72f8d6641 +share | 45 +verified | f +seq | 1 +slot_updated | 227661765 +position | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_grouping.txt new file mode 100644 index 000000000..7683f1002 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_grouping.txt @@ -0,0 +1,8 @@ +-[ RECORD 1 ]--+------------------------------------------------------------------- +asset_id | \x03b8abdca02da73970dd4e2ba783224108acff30f31db83c40d5638ce67fc102 +group_key | collection +group_value | 5SqxHDvZ5yji5fr2v8MXkiT5QHSxnTjEw7feeds9EfDW +seq | +slot_updated | 227661768 +verified | t +group_info_seq | 2 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_cl_items.txt new file mode 100644 index 000000000..98c949449 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_cl_items.txt @@ -0,0 +1,18 @@ + tree | node_idx | leaf_idx | seq | level | hash +--------------------------------------------------------------------+----------+----------+-----+-------+-------------------------------------------------------------------- + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 16384 | 0 | 2 | 0 | \x869e0d7e57274e1a00964a751dfc885f583b768ffbbe8f33b1bb8c945b0fe115 + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 8192 | | 2 | 1 | \x49afc4198598c508073bea7bdeb6b4cdf2c24808a0e5d8f8c88b5bfd6c5baea1 + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 4096 | | 2 | 2 | \x15938cca95120f1b49b1f6ae837ad575749e1fb6c815c17ee1a3d6970d0b8f23 + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 2048 | | 2 | 3 | \x2eabfdb34b5065ae920c30526c6a324b02970e2cc93bd5eaf9736de69ab60d30 + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 1024 | | 2 | 4 | \xa5bf6fc08506ba0f750826f725a147bdb9bce9e51376f4420ac9dc4ae0e0f8ec + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 512 | | 2 | 5 | \xe3995eeee8bf65819dbc2076ac2b8f614ae1d9eec81e16e3d288834005e9d71b + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 256 | | 2 | 6 | \x5e3fb324a4a9315f2899bf9a830a3b715cedf856cf9f7597b4bb6c87a56153de + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 128 | | 2 | 7 | \xae5658127500d0298ab7d06b978361c2787c9705c41c2d06f82b176569d8ee72 + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 64 | | 2 | 8 | \x0f759720f10b760132a2341f5d33581f0eca3d3bce394d5deba4ee837e5a2f05 + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 32 | | 2 | 9 | \xe4b269ff839c09d341ee592b3fd3edb2e304c4556364eba09e04d416500e8e8b + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 16 | | 2 | 10 | \x0c85c94fdbd81ad2e80d6cad7d67ca6072d3d9546d5e11276c41d6f71b87997f + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 8 | | 2 | 11 | \x231ed9314365b7e6adee7efb8de03e2becd7b9ae1eca8bcc25b00b1e17b29964 + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 4 | | 2 | 12 | \x05fde99ac00a91540024d82731ea6eb18434e497d6d3ae4641f4d989af50ffa7 + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 2 | | 2 | 13 | \x31ee82d19bc8ef39f86427013854fafde8ffdb2375deb9aeb9538f23be666736 + \x9043c3758809749b31418338a2f6d142c6e7b1a314549b9edb8617a7c04e17e8 | 1 | | 2 | 14 | \xb53d2998178b73cb8d4eca4588e1b37bd4f994cc5eabb4466014ad891df7afd2 +(15 rows) \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_creator.scenario b/tools/txn_forwarder/bubblegum_tests/mint_verify_creator.scenario new file mode 100644 index 000000000..25ad8a539 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_creator.scenario @@ -0,0 +1,2 @@ +37ts5SqpNazPTp26VfC4oeuXpXezKYkD9oarczPNaE8TUGG8msifnTYTBJiBZNBeAUGrNw85EEfwnR1t9SieKTdq +4xrw5UwQSxxPzVxge6fbtmgLNsT2amaGrwpZFE95peRbnHGpxWtS2fF7whXW2xma4i2KDXdneztJZCAtgGZKTw11 diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset.txt new file mode 100644 index 000000000..53b7dac0d --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset.txt @@ -0,0 +1,28 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \x482e7bf66656da08580e3e68051fc47817a836103ed90c67a12d71a2e40ce6da +alt_id | +specification_version | v1 +specification_asset_class | NFT +owner | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | +compressed | t +compressible | f +seq | 2 +tree_id | \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 +leaf | \x55bb6cc4f75588666a32c06370e4b5653a05f5f1f86527f6c9c5f6fe0f1c72f0 +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | \x482e7bf66656da08580e3e68051fc47817a836103ed90c67a12d71a2e40ce6da +burnt | f +slot_updated | 226295481 +data_hash | 31vt7MSZzRykZN1FjQktuk8oaWCVL9SzfMyX9Q2RtTaa +creator_hash | 4GAv4MMcgC7xjLuLHSMxxoRpp2cCbz52f9vhYK7GNZMX +owner_delegate_seq | 2 +leaf_seq | 2 +base_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_creators.txt new file mode 100644 index 000000000..ce2f62f42 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_creators.txt @@ -0,0 +1,16 @@ +-[ RECORD 1 ]+------------------------------------------------------------------- +asset_id | \x482e7bf66656da08580e3e68051fc47817a836103ed90c67a12d71a2e40ce6da +creator | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +share | 55 +verified | f +seq | 2 +slot_updated | 226295484 +position | 0 +-[ RECORD 2 ]+------------------------------------------------------------------- +asset_id | \x482e7bf66656da08580e3e68051fc47817a836103ed90c67a12d71a2e40ce6da +creator | \x0cac282cf9edd5e592590263225c9424f64fe68a32021187a17d0df9dd464c44 +share | 45 +verified | t +seq | 2 +slot_updated | 226295484 +position | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_grouping.txt new file mode 100644 index 000000000..c0ade31ae --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_grouping.txt @@ -0,0 +1,8 @@ +-[ RECORD 1 ]--+------------------------------------------------------------------- +asset_id | \x482e7bf66656da08580e3e68051fc47817a836103ed90c67a12d71a2e40ce6da +group_key | collection +group_value | +seq | +slot_updated | 226295481 +verified | f +group_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_cl_items.txt new file mode 100644 index 000000000..128fa7b63 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_cl_items.txt @@ -0,0 +1,18 @@ + tree | node_idx | leaf_idx | seq | level | hash +--------------------------------------------------------------------+----------+----------+-----+-------+-------------------------------------------------------------------- + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 16384 | 0 | 2 | 0 | \x55bb6cc4f75588666a32c06370e4b5653a05f5f1f86527f6c9c5f6fe0f1c72f0 + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 8192 | | 2 | 1 | \x2a9201456f427d4c29b41c89f492d75235c918e1c8eaf6400310e75632318802 + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 4096 | | 2 | 2 | \xc96766fbdcb9eb4c4ae8939595adb34066dc5cf9453a707ea7fd26729e231ccc + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 2048 | | 2 | 3 | \xf186e76c8633f893a9e99d108087e4de194ea7c4c1864d06309fe21bb350da5f + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 1024 | | 2 | 4 | \xa1056ad4a6ba2d7e836bf2beec305382f0b431cdbe9cf9fccc6ed078bd8ccd68 + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 512 | | 2 | 5 | \xb58becac8e5106a7b56362f3c526c5a210a093a168ace4788ba9e0e3adfc7fd2 + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 256 | | 2 | 6 | \xd7f345939b46e69df3e6db6303e1e8021264aa7448eda5c07176b852393f5d5d + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 128 | | 2 | 7 | \x73ea7f707a7a2c0423295f43ca4bc70e794e8f81641d81da751b19710950b24e + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 64 | | 2 | 8 | \x820272ee3e42619c9b900c9368270a75a8ff4cf28274d06dd83e130a15a5090b + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 32 | | 2 | 9 | \xdf85812c52811baa0da7e35562f800c2dc4637a9a54ddee041cae4c29cedbd5a + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 16 | | 2 | 10 | \xa60e02ba2e1473d096b1792abd93f4415f4961cb95d6c5ff8881e11ac36b7c92 + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 8 | | 2 | 11 | \x50a27c2a6942bd5cf64d8d3b74e8ccfd51fadc16ecb3dfd8e6200ea647b9f937 + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 4 | | 2 | 12 | \x6945ae75593b1f82975848caccbc647fb54ef27bbbbb866cd750e1c383ed57e7 + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 2 | | 2 | 13 | \x828ffbdfa1124da75e705bb31a501f523333a74b1d42d8ba3c7b096daaf6103a + \x520fb79c4473c67eef2052359dc15eec3d99acb23642b107badae49bc2dddb83 | 1 | | 2 | 14 | \x6236ef1da7487526e1e2e1bacc6b93689a5bae9fb46c5c1f766e4f60c25afb93 +(15 rows) \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh index a15342360..88de81644 100755 --- a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh +++ b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh @@ -8,7 +8,9 @@ SCENARIOS=("mint_transfer_burn.scenario" \ "mint_redeem_decompress.scenario" "mint_redeem_cancel_redeem_redeem_decompress.scenario" \ "mint_transfer_transfer.scenario" \ -"mint_delegate_transfer.scenario" +"mint_delegate_transfer.scenario" \ +"mint_verify_creator.scenario" \ +"mint_verify_collection.scenario" ) if [ ${#SCENARIOS[@]} -gt 0 ]; then From e28b758b1977eb1b2ce34431959f2671a8ef9943 Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Wed, 3 Jan 2024 15:03:21 -0800 Subject: [PATCH 07/12] Add more collection verification tests --- .../mint_set_and_verify_collection.scenario | 2 ++ .../mint_set_and_verify_collection_asset.txt | 28 +++++++++++++++++++ ...t_and_verify_collection_asset_creators.txt | 16 +++++++++++ ...t_and_verify_collection_asset_grouping.txt | 8 ++++++ ...int_set_and_verify_collection_cl_items.txt | 18 ++++++++++++ ...to_collection_unverify_collection.scenario | 2 ++ ...o_collection_unverify_collection_asset.txt | 28 +++++++++++++++++++ ...ion_unverify_collection_asset_creators.txt | 16 +++++++++++ ...ion_unverify_collection_asset_grouping.txt | 8 ++++++ ...ollection_unverify_collection_cl_items.txt | 18 ++++++++++++ ...fy_collection_unverify_collection.scenario | 3 ++ ...y_collection_unverify_collection_asset.txt | 28 +++++++++++++++++++ ...ion_unverify_collection_asset_creators.txt | 16 +++++++++++ ...ion_unverify_collection_asset_grouping.txt | 8 ++++++ ...ollection_unverify_collection_cl_items.txt | 18 ++++++++++++ .../run-bubblegum-sequences.sh | 5 +++- 16 files changed, 221 insertions(+), 1 deletion(-) create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection.scenario create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_creators.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_grouping.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_cl_items.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection.scenario create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_creators.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_grouping.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_cl_items.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection.scenario create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_creators.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_grouping.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection.scenario b/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection.scenario new file mode 100644 index 000000000..fec625aef --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection.scenario @@ -0,0 +1,2 @@ +63xhs5bXcuMR3uMACXWkkFMm7BJ9Thknh7WNMPzV8HJBNwpyxJTr98NrLFHnTZDHdSUFD42VFQx8rjSaGynWbaRs +5ZKjPxm3WAZzuqqkCDjgKpm9b5XjB9cuvv68JvXxWThvJaJxcMJgpSbYs4gDA9dGJyeLzsgNtnS6oubANF1KbBmt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset.txt new file mode 100644 index 000000000..9a54a14fa --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset.txt @@ -0,0 +1,28 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \x1679ec700d2cf85da62294237cedf6b7c57ea3a28940ec152c3c6a65c271f9a3 +alt_id | +specification_version | v1 +specification_asset_class | NFT +owner | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | +compressed | t +compressible | f +seq | 2 +tree_id | \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d +leaf | \xbaff0b3bfa1cbe7b2f4f5e835cc3837b4c2b042d5042d09aba0527cdb86b9e49 +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | \x1679ec700d2cf85da62294237cedf6b7c57ea3a28940ec152c3c6a65c271f9a3 +burnt | f +slot_updated | 232170413 +data_hash | 5qnPtMuhWzj8rRviKV1YRitUxgt4iFqFkpvyuBn5rTKW +creator_hash | FM4zS99NvwRZm5UGgcJW1pQEWDtpgH4jaiCaTkMn6mxD +owner_delegate_seq | 1 +leaf_seq | 2 +base_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_creators.txt new file mode 100644 index 000000000..69eb99418 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_creators.txt @@ -0,0 +1,16 @@ +-[ RECORD 1 ]+------------------------------------------------------------------- +asset_id | \x1679ec700d2cf85da62294237cedf6b7c57ea3a28940ec152c3c6a65c271f9a3 +creator | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +share | 55 +verified | f +seq | 1 +slot_updated | 232170413 +position | 0 +-[ RECORD 2 ]+------------------------------------------------------------------- +asset_id | \x1679ec700d2cf85da62294237cedf6b7c57ea3a28940ec152c3c6a65c271f9a3 +creator | \x762cfc08d3cd38537a7e610d93288350dd0b39fb530512230ffd0aee29238fdc +share | 45 +verified | f +seq | 1 +slot_updated | 232170413 +position | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_grouping.txt new file mode 100644 index 000000000..69b52aec8 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_grouping.txt @@ -0,0 +1,8 @@ +-[ RECORD 1 ]--+------------------------------------------------------------------- +asset_id | \x1679ec700d2cf85da62294237cedf6b7c57ea3a28940ec152c3c6a65c271f9a3 +group_key | collection +group_value | 4zapNXifB7Lz5XGUtsYQ3gsEujK2dqFw4mE9NY57NrtD +seq | +slot_updated | 232170416 +verified | t +group_info_seq | 2 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_cl_items.txt new file mode 100644 index 000000000..1743e0c68 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_cl_items.txt @@ -0,0 +1,18 @@ + tree | node_idx | leaf_idx | seq | level | hash +--------------------------------------------------------------------+----------+----------+-----+-------+-------------------------------------------------------------------- + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 16384 | 0 | 2 | 0 | \xbaff0b3bfa1cbe7b2f4f5e835cc3837b4c2b042d5042d09aba0527cdb86b9e49 + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 8192 | | 2 | 1 | \xf1dec0e2954753f944bab7070461e62cc5d7ecd1e08251e635f8f739a03267b5 + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 4096 | | 2 | 2 | \x4e483b3e0eeac96dd1cee947708ff44a86d86d6836f68eedd885c641a1e574fd + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 2048 | | 2 | 3 | \x6c0a6b99fcd38aab086faaa90e239ff8ef0b3fe3c063b081ad7f3983b55f924b + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 1024 | | 2 | 4 | \x6d491b940d2a449ded3a13a6e1e4a68cb9f4487256f46d470d3c0b2e5009e8e2 + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 512 | | 2 | 5 | \xe74605586038af7c4156228834d4cca0030f075e7df71e13ec3200e7fb401ac6 + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 256 | | 2 | 6 | \x9ee71499317d35ee7e1c63bda5f94950f7abfac94ba1eac13645ec9f0c07290d + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 128 | | 2 | 7 | \x69c82b7a5ec22ae612da8d754eaf1eb408f95470744102df7748ae89e2c2cffb + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 64 | | 2 | 8 | \xb7a855980446bc5c998ad8c827799e250e376350df8b86646b447c3cfc1d56c1 + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 32 | | 2 | 9 | \xda3c1ed8903739bfba96e16b262d20babfdc16d60332a6c3b14531d726c74915 + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 16 | | 2 | 10 | \xf3131a32c3524e825036d0e704ec75fd44e4f843ed32a8bd219753c9caaa8b42 + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 8 | | 2 | 11 | \x0777f200acfeee73ce73ab8a13cc5f7bb28de7d880a6ca5349ec8948ef2563af + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 4 | | 2 | 12 | \x90b801463c1614468d210b2a14a7080e15c992604fb7fb50c729658051f76440 + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 2 | | 2 | 13 | \xe29ffdf48e9270a9e9cd9391ccabf7cc0381fe3ac1a0423498ace002b8f114ac + \xd1b9bbe9ece797ea5db10e674caaf8cf59604cea8e386307b51839795663a42d | 1 | | 2 | 14 | \x914743a17cc0078161eb98560e7833eb9b6079f58140a06c96331746e06d2dd9 +(15 rows) \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection.scenario b/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection.scenario new file mode 100644 index 000000000..2f1a47700 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection.scenario @@ -0,0 +1,2 @@ +tzXASugk8578bmtA3JAFQLEfcVQp3Np3rU9fyFas2Svk8nyBHXJnf7PdqebGNsSTwx6CEWpDCP5oLoCDcmbP35B +7nK9a2DSDZ4Gh6DatmxGJmuLiDEswaY9bYSSPTtQppk7PtLKXYE84jWzm7AC4G1fpa831GaXuXcn5n5ybWqB4e5 diff --git a/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset.txt new file mode 100644 index 000000000..59f0eb755 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset.txt @@ -0,0 +1,28 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \x18e8b7e61a39441667dc71c6c44b0a7966612af1428740bb00dcce262ba00673 +alt_id | +specification_version | v1 +specification_asset_class | NFT +owner | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | +compressed | t +compressible | f +seq | 2 +tree_id | \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 +leaf | \x141f160c6f7454ae734e756841611f30a92cc21f0e2348ad414b3735a3f1ff3f +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | \x18e8b7e61a39441667dc71c6c44b0a7966612af1428740bb00dcce262ba00673 +burnt | f +slot_updated | 232178646 +data_hash | 8M8DpVvA1aGNMV6xMViDyEF9oS89VKqbWsxBfUNkGGQ9 +creator_hash | 4q4TdVGLUpKPvHqZT57xM66gZyAjViQdPPsZKoHPRZni +owner_delegate_seq | 1 +leaf_seq | 2 +base_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_creators.txt new file mode 100644 index 000000000..d62d5e4a8 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_creators.txt @@ -0,0 +1,16 @@ +-[ RECORD 1 ]+------------------------------------------------------------------- +asset_id | \x18e8b7e61a39441667dc71c6c44b0a7966612af1428740bb00dcce262ba00673 +creator | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +share | 55 +verified | f +seq | 1 +slot_updated | 232178646 +position | 0 +-[ RECORD 2 ]+------------------------------------------------------------------- +asset_id | \x18e8b7e61a39441667dc71c6c44b0a7966612af1428740bb00dcce262ba00673 +creator | \xb1a13104bb97088dae4656d8ffa064b9dc032f914a6f6e53aa99db1a9c7a698a +share | 45 +verified | f +seq | 1 +slot_updated | 232178646 +position | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_grouping.txt new file mode 100644 index 000000000..72b43d773 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_grouping.txt @@ -0,0 +1,8 @@ +-[ RECORD 1 ]--+------------------------------------------------------------------- +asset_id | \x18e8b7e61a39441667dc71c6c44b0a7966612af1428740bb00dcce262ba00673 +group_key | collection +group_value | DdyrHTfN4wskbqTm3NDbAvRDsqiewzkuMboMRYJmNG6A +seq | +slot_updated | 232178649 +verified | f +group_info_seq | 2 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_cl_items.txt new file mode 100644 index 000000000..5f46389e7 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_cl_items.txt @@ -0,0 +1,18 @@ + tree | node_idx | leaf_idx | seq | level | hash +--------------------------------------------------------------------+----------+----------+-----+-------+-------------------------------------------------------------------- + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 16384 | 0 | 2 | 0 | \x141f160c6f7454ae734e756841611f30a92cc21f0e2348ad414b3735a3f1ff3f + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 8192 | | 2 | 1 | \x42c4bbeaf8a0f58b61145079fc1c0cd777c2d6bf63a7456ee1aecd57beb4e5da + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 4096 | | 2 | 2 | \x8d4b3619905066948dc391c8d0783f144999b5a4ef618921e0d6c266f8d513b4 + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 2048 | | 2 | 3 | \x8e3266f479bc71d6e272fd7884aebf1a1adb5687bb8d2d7e442b7da3f499e665 + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 1024 | | 2 | 4 | \xb81f5707fbde5887d32a20454bd68871516166511f69da5c3b734faa6054f10d + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 512 | | 2 | 5 | \x6f22edcbbdf13845a678146c53a4ee282ddf4ee39098b90a92f1779521a2a48b + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 256 | | 2 | 6 | \x4b940b307dee07066e114216c1fc8e495004251b8e64033eadc5af1ee1620ef4 + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 128 | | 2 | 7 | \x7f0293e8806809fca1ce681a5f3771d402ba57b17bfa39be0c724fd840a8641c + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 64 | | 2 | 8 | \x7d5c360f403e54db57ccf79d4eba614477dc570124f29f410e20138c11439b11 + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 32 | | 2 | 9 | \x2def95027d82ba70b28a524a7e869fd11ec9b999b8bb1e5ab8c5081e60a71c6f + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 16 | | 2 | 10 | \xfb7ae96ce567baf3bc1dd64127005074e4d6b97a0016f8427a44b26aedf50084 + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 8 | | 2 | 11 | \x76390000c0c3912f5ad6a0f172a2629c0a347a5d8479b98b40610bd4fd29fb51 + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 4 | | 2 | 12 | \x500cf50ef2d2c482fbc609f97b6e214951b3f5893cbc6d8940ff9ce53cf3e566 + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 2 | | 2 | 13 | \x4232ac08f864fe179bd15d13f9f1a6026361aad50da14cc8a4aa3f864932ffe2 + \xadeec96ee34d67ca663c90e0504014f8688f336c09509707c27556a2abceaa63 | 1 | | 2 | 14 | \x9c4a749767da0b84013f6404f88411ee3f4b1b34564b6db953463e9f8e8c6786 +(15 rows) \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection.scenario b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection.scenario new file mode 100644 index 000000000..dff9bb6ae --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection.scenario @@ -0,0 +1,3 @@ +5uWXt8JAhuP2XQ2nYJTq8Ndp34fdG3vmJ7DJnb3bE6iyrZZ6jeuN9w5jZvKrduMDu4zKyQU7A3JtswhKxE3hjKBk +4hQQsDKgDx5PpZR7nGvxKsLSvX4J7voaiJC3ag7dPuu4HY5kbvaqD2gyeHbdja1f22ypmzouRNpuo6sbyGDSSgya +5k71fZRpRagY45ZYu13Q8C3Bmw6KFPBkRmbBx2NuYk7roVtvM8P16WouCZtnkhRCyKyQHSgHKyTY92t9aq2tyLdd diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset.txt new file mode 100644 index 000000000..774fe3909 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset.txt @@ -0,0 +1,28 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \x9f2817615e1440416649df6d4c4f5d71895a754e75ddf59ae01307e758f6a964 +alt_id | +specification_version | v1 +specification_asset_class | NFT +owner | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | +compressed | t +compressible | f +seq | 3 +tree_id | \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef +leaf | \xa0df0b8f5870c42cf5f000cb93ac2407dc05a7b0e5708027cea879deaf672b86 +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | \x9f2817615e1440416649df6d4c4f5d71895a754e75ddf59ae01307e758f6a964 +burnt | f +slot_updated | 232161591 +data_hash | 8wZ2jDVA3gdirM6QtZrQHBcuJsLM4TZusEAKEEfSvgKw +creator_hash | A8KEBkNKGsouiKAsE5ARHqNHGTb7ZzPi6LHesaZCL4Aw +owner_delegate_seq | 1 +leaf_seq | 3 +base_info_seq | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_creators.txt new file mode 100644 index 000000000..48e8eba4c --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_creators.txt @@ -0,0 +1,16 @@ +-[ RECORD 1 ]+------------------------------------------------------------------- +asset_id | \x9f2817615e1440416649df6d4c4f5d71895a754e75ddf59ae01307e758f6a964 +creator | \xdc53343c46e5d7a1bd08f4780285621202f66b596f984e940a5eb423ac560fed +share | 55 +verified | f +seq | 1 +slot_updated | 232161591 +position | 0 +-[ RECORD 2 ]+------------------------------------------------------------------- +asset_id | \x9f2817615e1440416649df6d4c4f5d71895a754e75ddf59ae01307e758f6a964 +creator | \x264a5d2758f44ed5e1ddd75d6d215a1eb1a58526fc9de24c1363d789ffeaa0e4 +share | 45 +verified | f +seq | 1 +slot_updated | 232161591 +position | 1 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_grouping.txt new file mode 100644 index 000000000..167976aef --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_grouping.txt @@ -0,0 +1,8 @@ +-[ RECORD 1 ]--+------------------------------------------------------------------- +asset_id | \x9f2817615e1440416649df6d4c4f5d71895a754e75ddf59ae01307e758f6a964 +group_key | collection +group_value | FhBQpV7TdZHZe6rrS9hVhkmBZbjE6RDkD5QJ8XgcYHYX +seq | +slot_updated | 232161593 +verified | f +group_info_seq | 3 \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_cl_items.txt new file mode 100644 index 000000000..22983bb02 --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_cl_items.txt @@ -0,0 +1,18 @@ + tree | node_idx | leaf_idx | seq | level | hash +--------------------------------------------------------------------+----------+----------+-----+-------+-------------------------------------------------------------------- + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 16384 | 0 | 3 | 0 | \xa0df0b8f5870c42cf5f000cb93ac2407dc05a7b0e5708027cea879deaf672b86 + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 8192 | | 3 | 1 | \x26636b1d764882db28d344654e080f97c4e471d8078fdf90e77210df986844c4 + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 4096 | | 3 | 2 | \x5a7eddee1704d208b2c9286f8f6f57e11fb4088b26b4490086d8e1f866220a1e + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 2048 | | 3 | 3 | \x514fb9d4695c72ca8976c59670fd7108ca2b01962837687856b445cca95a273e + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 1024 | | 3 | 4 | \x6765d6f0594bdb48d2fe2eff283e66c966e9751c64c9c6d54c9052a1da6cb3ba + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 512 | | 3 | 5 | \x55aebf7da4895b8336ed31a9cd2d3690813a5521fd0c06b98bee582aefb4e9b6 + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 256 | | 3 | 6 | \x9bf9878fdb11dcf5409555da88815ea2fa36f6274bbf766396cbc115fbdc9971 + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 128 | | 3 | 7 | \xc3b2fb6bfaa3572d89e585fc1c01c424526125ee4d61b0351dd171538d8656e7 + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 64 | | 3 | 8 | \x1ddb72f4872089fe09e731304bb37abf087091d76b538de8337c2667bbf71771 + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 32 | | 3 | 9 | \x7c550bff142bb8ea40dd8077f5ef107f59ddb41485b59f75cc79bf4a32f672d4 + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 16 | | 3 | 10 | \xcf945e99644b0bce7a632f75d5583af3bd253347060b46cb4b9a6b37680f23e2 + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 8 | | 3 | 11 | \x8f8437650f74136e93236fadbe982efe7a3c7242fe5e1a7dbb828df498085787 + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 4 | | 3 | 12 | \x6ad32435b390970745116398cfdbafcefeb17d9593c95d395654454c897942a2 + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 2 | | 3 | 13 | \x61d24822e4adb1eb6fcd15acb5af19cb87e7a7696f5feef168a7b26da4ca99a1 + \x5be27efa6443d455b8a30f07cccfe55ad425858aaab1f9bf958a9ee28a3e71ef | 1 | | 3 | 14 | \xfd63d7da0c2dda3f85d7c393a9c5b4ae1c1d953834c5371a67ee282e8cc47149 +(15 rows) \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh index 88de81644..29ad5b5b5 100755 --- a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh +++ b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh @@ -10,7 +10,10 @@ SCENARIOS=("mint_transfer_burn.scenario" \ "mint_transfer_transfer.scenario" \ "mint_delegate_transfer.scenario" \ "mint_verify_creator.scenario" \ -"mint_verify_collection.scenario" +"mint_verify_collection.scenario" \ +"mint_verify_collection_unverify_collection.scenario" \ +"mint_set_and_verify_collection.scenario" \ +"mint_to_collection_unverify_collection.scenario" ) if [ ${#SCENARIOS[@]} -gt 0 ]; then From 40665e5d468d7d894b1645b775b4542f0c4e540a Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Wed, 3 Jan 2024 16:06:51 -0800 Subject: [PATCH 08/12] Move test data to subirectory --- .../bubblegum_tests/run-bubblegum-sequences.sh | 16 +++++++--------- .../mint_delegate_transfer.scenario | 0 .../mint_delegate_transfer_asset.txt | 0 .../mint_delegate_transfer_asset_creators.txt | 0 .../mint_delegate_transfer_asset_grouping.txt | 0 .../mint_delegate_transfer_cl_items.txt | 0 ...deem_cancel_redeem_redeem_decompress.scenario | 0 ...eem_cancel_redeem_redeem_decompress_asset.txt | 0 ...l_redeem_redeem_decompress_asset_creators.txt | 0 ...l_redeem_redeem_decompress_asset_grouping.txt | 0 ..._cancel_redeem_redeem_decompress_cl_items.txt | 0 .../mint_redeem_decompress.scenario | 0 .../mint_redeem_decompress_asset.txt | 0 .../mint_redeem_decompress_asset_creators.txt | 0 .../mint_redeem_decompress_asset_grouping.txt | 0 .../mint_redeem_decompress_cl_items.txt | 0 .../mint_set_and_verify_collection.scenario | 0 .../mint_set_and_verify_collection_asset.txt | 0 ..._set_and_verify_collection_asset_creators.txt | 0 ..._set_and_verify_collection_asset_grouping.txt | 0 .../mint_set_and_verify_collection_cl_items.txt | 0 ...nt_to_collection_unverify_collection.scenario | 0 ...t_to_collection_unverify_collection_asset.txt | 0 ...ection_unverify_collection_asset_creators.txt | 0 ...ection_unverify_collection_asset_grouping.txt | 0 ...o_collection_unverify_collection_cl_items.txt | 0 .../mint_transfer_burn.scenario | 0 .../mint_transfer_burn_asset.txt | 0 .../mint_transfer_burn_asset_creators.txt | 0 .../mint_transfer_burn_asset_grouping.txt | 0 .../mint_transfer_burn_cl_items.txt | 0 .../mint_transfer_transfer.scenario | 0 .../mint_transfer_transfer_asset.txt | 0 .../mint_transfer_transfer_asset_creators.txt | 0 .../mint_transfer_transfer_asset_grouping.txt | 0 .../mint_transfer_transfer_cl_items.txt | 0 .../mint_verify_collection.scenario | 0 .../mint_verify_collection_asset.txt | 0 .../mint_verify_collection_asset_creators.txt | 0 .../mint_verify_collection_asset_grouping.txt | 0 .../mint_verify_collection_cl_items.txt | 0 ...erify_collection_unverify_collection.scenario | 0 ...rify_collection_unverify_collection_asset.txt | 0 ...ection_unverify_collection_asset_creators.txt | 0 ...ection_unverify_collection_asset_grouping.txt | 0 ...y_collection_unverify_collection_cl_items.txt | 0 .../mint_verify_creator.scenario | 0 .../mint_verify_creator_asset.txt | 0 .../mint_verify_creator_asset_creators.txt | 0 .../mint_verify_creator_asset_grouping.txt | 0 .../mint_verify_creator_cl_items.txt | 0 51 files changed, 7 insertions(+), 9 deletions(-) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_delegate_transfer.scenario (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_delegate_transfer_asset.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_delegate_transfer_asset_creators.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_delegate_transfer_asset_grouping.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_delegate_transfer_cl_items.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_redeem_cancel_redeem_redeem_decompress.scenario (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_redeem_cancel_redeem_redeem_decompress_asset.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_redeem_cancel_redeem_redeem_decompress_asset_creators.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_redeem_cancel_redeem_redeem_decompress_asset_grouping.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_redeem_cancel_redeem_redeem_decompress_cl_items.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_redeem_decompress.scenario (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_redeem_decompress_asset.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_redeem_decompress_asset_creators.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_redeem_decompress_asset_grouping.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_redeem_decompress_cl_items.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_set_and_verify_collection.scenario (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_set_and_verify_collection_asset.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_set_and_verify_collection_asset_creators.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_set_and_verify_collection_asset_grouping.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_set_and_verify_collection_cl_items.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_to_collection_unverify_collection.scenario (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_to_collection_unverify_collection_asset.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_to_collection_unverify_collection_asset_creators.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_to_collection_unverify_collection_asset_grouping.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_to_collection_unverify_collection_cl_items.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_transfer_burn.scenario (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_transfer_burn_asset.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_transfer_burn_asset_creators.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_transfer_burn_asset_grouping.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_transfer_burn_cl_items.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_transfer_transfer.scenario (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_transfer_transfer_asset.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_transfer_transfer_asset_creators.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_transfer_transfer_asset_grouping.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_transfer_transfer_cl_items.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_collection.scenario (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_collection_asset.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_collection_asset_creators.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_collection_asset_grouping.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_collection_cl_items.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_collection_unverify_collection.scenario (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_collection_unverify_collection_asset.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_collection_unverify_collection_asset_creators.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_collection_unverify_collection_asset_grouping.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_collection_unverify_collection_cl_items.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_creator.scenario (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_creator_asset.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_creator_asset_creators.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_creator_asset_grouping.txt (100%) rename tools/txn_forwarder/bubblegum_tests/{ => test_scenario_data}/mint_verify_creator_cl_items.txt (100%) diff --git a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh index 29ad5b5b5..70fea56db 100755 --- a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh +++ b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh @@ -18,10 +18,8 @@ SCENARIOS=("mint_transfer_burn.scenario" \ if [ ${#SCENARIOS[@]} -gt 0 ]; then echo "Running ${#SCENARIOS[@]} scenarios" -else - echo "NO SCENARIOS FOUND!" - exit 1 fi +TEST_SCENARIO_DATA_DIR="test_scenario_data" # 0 is pass, 1 is fail. STATUS=0 @@ -29,7 +27,7 @@ STATUS=0 # Run each scenario and check for expected database result. for i in ${!SCENARIOS[@]}; do # Read in the `asset` file for this scenario. - EXPECTED_ASSET_FILE="$(basename "${SCENARIOS[$i]}" .scenario)_asset.txt" + EXPECTED_ASSET_FILE="$TEST_SCENARIO_DATA_DIR/$(basename "${SCENARIOS[$i]}" .scenario)_asset.txt" if [ ! -f "$EXPECTED_ASSET_FILE" ]; then echo $(RED "${SCENARIOS[$i]} missing asset file") STATUS=1 @@ -57,7 +55,7 @@ for i in ${!SCENARIOS[@]}; do fi # Read in the `asset_creators` file for this scenario. - EXPECTED_ASSET_CREATORS_FILE="$(basename "${SCENARIOS[$i]}" .scenario)_asset_creators.txt" + EXPECTED_ASSET_CREATORS_FILE="$TEST_SCENARIO_DATA_DIR/$(basename "${SCENARIOS[$i]}" .scenario)_asset_creators.txt" if [ ! -f "$EXPECTED_ASSET_CREATORS_FILE" ]; then echo $(RED "${SCENARIOS[$i]} missing asset_creators file") STATUS=1 @@ -79,7 +77,7 @@ for i in ${!SCENARIOS[@]}; do fi # Read in the `asset_grouping` file for this scenario. - EXPECTED_ASSET_GROUPING_FILE="$(basename "${SCENARIOS[$i]}" .scenario)_asset_grouping.txt" + EXPECTED_ASSET_GROUPING_FILE="$TEST_SCENARIO_DATA_DIR/$(basename "${SCENARIOS[$i]}" .scenario)_asset_grouping.txt" if [ ! -f "$EXPECTED_ASSET_GROUPING_FILE" ]; then echo $(RED "${SCENARIOS[$i]} missing asset_grouping file") STATUS=1 @@ -100,7 +98,7 @@ for i in ${!SCENARIOS[@]}; do fi # Read in the `cl_items` file for this scenario. - EXPECTED_CL_ITEMS_FILE="$(basename "${SCENARIOS[$i]}" .scenario)_cl_items.txt" + EXPECTED_CL_ITEMS_FILE="$TEST_SCENARIO_DATA_DIR/$(basename "${SCENARIOS[$i]}" .scenario)_cl_items.txt" if [ ! -f "$EXPECTED_CL_ITEMS_FILE" ]; then echo $(RED "${SCENARIOS[$i]} missing cl_items file") STATUS=1 @@ -129,7 +127,7 @@ for i in ${!SCENARIOS[@]}; do # Run the scenario file that indexes the asset. These are done with separate calls to the `txn_forwarder` # in order to enforce order. Just calling the `txn_forwarder` with the file results in random ordering. - readarray -t TXS < "${SCENARIOS[$i]}" + readarray -t TXS < "$TEST_SCENARIO_DATA_DIR/${SCENARIOS[$i]}" for TX in ${TXS[@]}; do (cd .. && \ @@ -141,7 +139,7 @@ for i in ${!SCENARIOS[@]}; do 2>&1 | grep -v "Group already exists: BUSYGROUP: Consumer Group name already exists") done - sleep 3 + sleep 2 # Asset should now be in `asset` table and all fields except `created_at` date match. DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_SQL") diff --git a/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer.scenario b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_delegate_transfer.scenario similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer.scenario rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_delegate_transfer.scenario diff --git a/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_delegate_transfer_asset.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_delegate_transfer_asset.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_delegate_transfer_asset_creators.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_creators.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_delegate_transfer_asset_creators.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_delegate_transfer_asset_grouping.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_asset_grouping.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_delegate_transfer_asset_grouping.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_delegate_transfer_cl_items.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_delegate_transfer_cl_items.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_delegate_transfer_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress.scenario b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress.scenario similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress.scenario rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress.scenario diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_asset.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_asset.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_asset_creators.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_creators.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_asset_creators.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_asset_grouping.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_asset_grouping.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_asset_grouping.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_cl_items.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_redeem_cancel_redeem_redeem_decompress_cl_items.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress.scenario b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress.scenario similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress.scenario rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress.scenario diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_asset.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_asset.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_asset_creators.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_creators.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_asset_creators.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_asset_grouping.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_asset_grouping.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_asset_grouping.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_cl_items.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_redeem_decompress_cl_items.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection.scenario b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_set_and_verify_collection.scenario similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection.scenario rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_set_and_verify_collection.scenario diff --git a/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_set_and_verify_collection_asset.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_set_and_verify_collection_asset.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_set_and_verify_collection_asset_creators.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_creators.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_set_and_verify_collection_asset_creators.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_set_and_verify_collection_asset_grouping.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_asset_grouping.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_set_and_verify_collection_asset_grouping.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_set_and_verify_collection_cl_items.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_set_and_verify_collection_cl_items.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_set_and_verify_collection_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection.scenario b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_to_collection_unverify_collection.scenario similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection.scenario rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_to_collection_unverify_collection.scenario diff --git a/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_to_collection_unverify_collection_asset.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_to_collection_unverify_collection_asset.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_to_collection_unverify_collection_asset_creators.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_creators.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_to_collection_unverify_collection_asset_creators.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_to_collection_unverify_collection_asset_grouping.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_asset_grouping.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_to_collection_unverify_collection_asset_grouping.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_to_collection_unverify_collection_cl_items.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_to_collection_unverify_collection_cl_items.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_to_collection_unverify_collection_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn.scenario b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_burn.scenario similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_transfer_burn.scenario rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_burn.scenario diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_burn_asset.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_burn_asset.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_burn_asset_creators.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_creators.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_burn_asset_creators.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_burn_asset_grouping.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_asset_grouping.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_burn_asset_grouping.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_burn_cl_items.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_transfer_burn_cl_items.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_burn_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer.scenario b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_transfer.scenario similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer.scenario rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_transfer.scenario diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_transfer_asset.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_transfer_asset.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_transfer_asset_creators.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_creators.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_transfer_asset_creators.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_transfer_asset_grouping.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_asset_grouping.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_transfer_asset_grouping.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_transfer_cl_items.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_transfer_transfer_cl_items.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_transfer_transfer_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection.scenario b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection.scenario similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_collection.scenario rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection.scenario diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_asset.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_asset.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_asset_creators.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_creators.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_asset_creators.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_asset_grouping.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_collection_asset_grouping.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_asset_grouping.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_cl_items.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_collection_cl_items.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection.scenario b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_unverify_collection.scenario similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection.scenario rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_unverify_collection.scenario diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_unverify_collection_asset.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_unverify_collection_asset.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_unverify_collection_asset_creators.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_creators.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_unverify_collection_asset_creators.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_unverify_collection_asset_grouping.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_asset_grouping.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_unverify_collection_asset_grouping.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_unverify_collection_cl_items.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_collection_unverify_collection_cl_items.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_collection_unverify_collection_cl_items.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_creator.scenario b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_creator.scenario similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_creator.scenario rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_creator.scenario diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_creator_asset.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_creator_asset.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_creators.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_creator_asset_creators.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_creators.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_creator_asset_creators.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_grouping.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_creator_asset_grouping.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_creator_asset_grouping.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_creator_asset_grouping.txt diff --git a/tools/txn_forwarder/bubblegum_tests/mint_verify_creator_cl_items.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_creator_cl_items.txt similarity index 100% rename from tools/txn_forwarder/bubblegum_tests/mint_verify_creator_cl_items.txt rename to tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_verify_creator_cl_items.txt From 922fcf1e43c72d4260b111cd4410e7f79a04de99 Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Wed, 3 Jan 2024 17:00:45 -0800 Subject: [PATCH 09/12] Move repeated code to functions --- .../run-bubblegum-sequences.sh | 204 ++++++------------ 1 file changed, 66 insertions(+), 138 deletions(-) diff --git a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh index 70fea56db..a9c2f51a0 100755 --- a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh +++ b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh @@ -1,9 +1,5 @@ #!/bin/bash -# Output colors. -RED() { echo $'\e[1;31m'$1$'\e[0m'; } -GRN() { echo $'\e[1;32m'$1$'\e[0m'; } - SCENARIOS=("mint_transfer_burn.scenario" \ "mint_redeem_decompress.scenario" "mint_redeem_cancel_redeem_redeem_decompress.scenario" \ @@ -16,24 +12,63 @@ SCENARIOS=("mint_transfer_burn.scenario" \ "mint_to_collection_unverify_collection.scenario" ) +TEST_SCENARIO_DATA_DIR="test_scenario_data" + +# Output text in colors. +# $1 is output text. +RED() { echo $'\e[1;31m'$1$'\e[0m'; } +GRN() { echo $'\e[1;32m'$1$'\e[0m'; } + +# Read from database using psql. +# $1 is SQL command. +# $2 extra CLI args to send to psql. +# $3 is expected value. +# $4 is topic for the pass/fail message. +READ_FROM_DATABASE() { + DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana "$2" --command="$1") + DATABASE_VAL=$(sed '/^created_at/d' <<< "$DATABASE_VAL") + if [ "$3" = "$DATABASE_VAL" ]; then + echo $(GRN "${SCENARIOS[$i]} $4 passed") >&2 + return 0 + else + echo $(RED "${SCENARIOS[$i]} $4 failed") >&2 + echo "Asset ID: $ASSET_ID" >&2 + echo "Expected:" >&2 + echo "$3" >&2 + echo "Actual:" >&2 + echo "$DATABASE_VAL" >&2 + return 1 + fi +} + +# Read in expected data from test data file. +# $1 is scenario file to use as a base name. +# $2 is the suffix for the type of test data, i.e. "asset", "cl_items", etc. +READ_IN_EXPECTED_DATA() { + local EXPECTED_DATA_FILE="$TEST_SCENARIO_DATA_DIR/$(basename "$1" .scenario)_"$2".txt" + if [ -f "$EXPECTED_DATA_FILE" ]; then + cat "$EXPECTED_DATA_FILE" + return 0 + else + echo $(RED "$1 missing $2 file") >&2 + return 1 + fi +} + if [ ${#SCENARIOS[@]} -gt 0 ]; then echo "Running ${#SCENARIOS[@]} scenarios" fi -TEST_SCENARIO_DATA_DIR="test_scenario_data" # 0 is pass, 1 is fail. STATUS=0 # Run each scenario and check for expected database result. for i in ${!SCENARIOS[@]}; do - # Read in the `asset` file for this scenario. - EXPECTED_ASSET_FILE="$TEST_SCENARIO_DATA_DIR/$(basename "${SCENARIOS[$i]}" .scenario)_asset.txt" - if [ ! -f "$EXPECTED_ASSET_FILE" ]; then - echo $(RED "${SCENARIOS[$i]} missing asset file") - STATUS=1 - continue - fi - EXPECTED_ASSET_VALUE=$(<"$EXPECTED_ASSET_FILE") + # Read in the expected database data for this scenario. + EXPECTED_ASSET_VALUE=$(READ_IN_EXPECTED_DATA "${SCENARIOS[$i]}" "asset") || { STATUS=1; continue; } + EXPECTED_ASSET_CREATORS=$(READ_IN_EXPECTED_DATA "${SCENARIOS[$i]}" "asset_creators") || { STATUS=1; continue; } + EXPECTED_ASSET_GROUPING=$(READ_IN_EXPECTED_DATA "${SCENARIOS[$i]}" "asset_grouping") || { STATUS=1; continue; } + EXPECTED_CL_ITEMS=$(READ_IN_EXPECTED_DATA "${SCENARIOS[$i]}" "cl_items") || { STATUS=1; continue; } # Parse out the asset ID. ASSET_ID=$(echo "$EXPECTED_ASSET_VALUE" | grep -oP '^(?!tree_id).*id\s+\|\s+\K[^ ]+') @@ -44,86 +79,32 @@ for i in ${!SCENARIOS[@]}; do continue fi - # Initially this asset should not be in `asset`` table. - ASSET_SQL="SELECT * FROM asset WHERE id = '$ASSET_ID';" - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_SQL") - if [ "(0 rows)" == "$DATABASE_VAL" ]; then - echo $(GRN "${SCENARIOS[$i]} initial asset table passed") - else - echo $(RED "${SCENARIOS[$i]} initial asset table failed") - STATUS=1 - fi - - # Read in the `asset_creators` file for this scenario. - EXPECTED_ASSET_CREATORS_FILE="$TEST_SCENARIO_DATA_DIR/$(basename "${SCENARIOS[$i]}" .scenario)_asset_creators.txt" - if [ ! -f "$EXPECTED_ASSET_CREATORS_FILE" ]; then - echo $(RED "${SCENARIOS[$i]} missing asset_creators file") + # Parse out the tree ID. + TREE_ID=$(echo "$EXPECTED_CL_ITEMS" | grep -oP '^\s*\K\\x[0-9a-f]+' | head -n 1) + if [ ${#TREE_ID} -ne 66 ]; then + echo $(RED "${SCENARIOS[$i]} incorrect asset ID parsing") + echo "Tree ID: $TREE_ID" STATUS=1 continue fi - EXPECTED_ASSET_CREATORS=$(<"$EXPECTED_ASSET_CREATORS_FILE") - # Initially this asset should not be in `asset_creators`` table. + # Initially this asset should not be in any database tables. + ASSET_SQL="SELECT * FROM asset WHERE id = '$ASSET_ID';" + READ_FROM_DATABASE "$ASSET_SQL" "-x" "(0 rows)" "initial asset table state" || STATUS=1 + ASSET_CREATORS_SQL="SELECT asset_id, creator, share, verified, seq, slot_updated, position \ FROM asset_creators \ WHERE asset_id = '$ASSET_ID' \ ORDER BY position;" - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_CREATORS_SQL") - if [ "(0 rows)" == "$DATABASE_VAL" ]; then - echo $(GRN "${SCENARIOS[$i]} initial asset_creators table passed") - else - echo $(RED "${SCENARIOS[$i]} initial asset_creators table failed") - STATUS=1 - fi + READ_FROM_DATABASE "$ASSET_CREATORS_SQL" "-x" "(0 rows)" "initial asset_creators table state" || STATUS=1 - # Read in the `asset_grouping` file for this scenario. - EXPECTED_ASSET_GROUPING_FILE="$TEST_SCENARIO_DATA_DIR/$(basename "${SCENARIOS[$i]}" .scenario)_asset_grouping.txt" - if [ ! -f "$EXPECTED_ASSET_GROUPING_FILE" ]; then - echo $(RED "${SCENARIOS[$i]} missing asset_grouping file") - STATUS=1 - continue - fi - EXPECTED_ASSET_GROUPING=$(<"$EXPECTED_ASSET_GROUPING_FILE") - - # Initially this asset should not be in `asset_grouping`` table. ASSET_GROUPING_SQL="SELECT asset_id, group_key, group_value, seq, slot_updated, verified, group_info_seq \ FROM asset_grouping \ WHERE asset_id = '$ASSET_ID';" - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_GROUPING_SQL") - if [ "(0 rows)" == "$DATABASE_VAL" ]; then - echo $(GRN "${SCENARIOS[$i]} initial asset_grouping table passed") - else - echo $(RED "${SCENARIOS[$i]} initial asset_grouping table failed") - STATUS=1 - fi + READ_FROM_DATABASE "$ASSET_GROUPING_SQL" "-x" "(0 rows)" "initial asset_grouping table state" || STATUS=1 - # Read in the `cl_items` file for this scenario. - EXPECTED_CL_ITEMS_FILE="$TEST_SCENARIO_DATA_DIR/$(basename "${SCENARIOS[$i]}" .scenario)_cl_items.txt" - if [ ! -f "$EXPECTED_CL_ITEMS_FILE" ]; then - echo $(RED "${SCENARIOS[$i]} missing cl_items file") - STATUS=1 - continue - fi - EXPECTED_CL_ITEMS=$(<"$EXPECTED_CL_ITEMS_FILE") - - # Parse out the tree ID. - TREE_ID=$(echo "$EXPECTED_CL_ITEMS" | grep -oP '^\s*\K\\x[0-9a-f]+' | head -n 1) - if [ ${#TREE_ID} -ne 66 ]; then - echo $(RED "${SCENARIOS[$i]} incorrect asset ID parsing") - echo "Tree ID: $TREE_ID" - STATUS=1 - continue - fi - - # Initially this tree should not be in `cl_items`` table. - SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$SQL") - if [ "(0 rows)" == "$DATABASE_VAL" ]; then - echo $(GRN "${SCENARIOS[$i]} initial cl_items table passed") - else - echo $(RED "${SCENARIOS[$i]} initial cl_items table failed") - STATUS=1 - fi + CL_ITEMS_SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" + READ_FROM_DATABASE "$CL_ITEMS_SQL" "-x" "(0 rows)" "initial cl_items table state" || STATUS=1 # Run the scenario file that indexes the asset. These are done with separate calls to the `txn_forwarder` # in order to enforce order. Just calling the `txn_forwarder` with the file results in random ordering. @@ -141,64 +122,11 @@ for i in ${!SCENARIOS[@]}; do sleep 2 - # Asset should now be in `asset` table and all fields except `created_at` date match. - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_SQL") - DATABASE_VAL_NO_DATE=$(sed '/^created_at/d' <<< "$DATABASE_VAL") - if [ "$EXPECTED_ASSET_VALUE" == "$DATABASE_VAL_NO_DATE" ]; then - echo $(GRN "${SCENARIOS[$i]} asset table passed") - else - echo $(RED "${SCENARIOS[$i]} asset table failed") - echo "Asset ID: $ASSET_ID" - echo "Expected:" - echo "$EXPECTED_ASSET_VALUE" - echo "Actual:" - echo "$DATABASE_VAL_NO_DATE" - STATUS=1 - fi - - # Asset should now be in `asset_creators` table and all fields match. - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_CREATORS_SQL") - if [ "$EXPECTED_ASSET_CREATORS" == "$DATABASE_VAL" ]; then - echo $(GRN "${SCENARIOS[$i]} asset_creators table passed") - else - echo $(RED "${SCENARIOS[$i]} asset_creators table failed") - echo "Asset ID: $ASSET_ID" - echo "Expected:" - echo "$EXPECTED_ASSET_CREATORS" - echo "Actual:" - echo "$DATABASE_VAL" - STATUS=1 - fi - - # Asset should now be in `asset_grouping` table and all fields match. - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana -x --command="$ASSET_GROUPING_SQL") - if [ "$EXPECTED_ASSET_GROUPING" == "$DATABASE_VAL" ]; then - echo $(GRN "${SCENARIOS[$i]} asset_grouping table passed") - else - echo $(RED "${SCENARIOS[$i]} asset_grouping table failed") - echo "Asset ID: $ASSET_ID" - echo "Expected:" - echo "$EXPECTED_ASSET_GROUPING" - echo "Actual:" - echo "$DATABASE_VAL" - STATUS=1 - fi - - # Tree should now be in `cl_items`` table and all fields match. - SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana --command="$SQL") - if [ "$EXPECTED_CL_ITEMS" == "$DATABASE_VAL" ]; then - echo $(GRN "${SCENARIOS[$i]} cl_items table passed") - else - echo $(RED "${SCENARIOS[$i]} cl_items table failed") - echo "Tree ID: $TREE_ID" - echo "Expected:" - echo "$EXPECTED_CL_ITEMS" - echo "Actual:" - echo "$DATABASE_VAL" - - STATUS=1 - fi + # Asset should now be in the database and all fields match (except `created_at` in `asset`` table). + READ_FROM_DATABASE "$ASSET_SQL" "-x" "$EXPECTED_ASSET_VALUE" "asset table" || STATUS=1 + READ_FROM_DATABASE "$ASSET_CREATORS_SQL" "-x" "$EXPECTED_ASSET_CREATORS" "asset_creators table" || STATUS=1 + READ_FROM_DATABASE "$ASSET_GROUPING_SQL" "-x" "$EXPECTED_ASSET_GROUPING" "asset_grouping table" || STATUS=1 + READ_FROM_DATABASE "$CL_ITEMS_SQL" "" "$EXPECTED_CL_ITEMS" "cl_items table" || STATUS=1 echo "" done From e9f04af4bb8287ac461141e2c44b5c7f383d1ed8 Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Thu, 4 Jan 2024 23:50:26 -0800 Subject: [PATCH 10/12] Add support for running sequences in reverse --- .../run-bubblegum-sequences.sh | 76 ++++++++++++++----- ...redeem_redeem_decompress_asset_reverse.txt | 28 +++++++ .../mint_redeem_decompress_asset_reverse.txt | 28 +++++++ 3 files changed, 113 insertions(+), 19 deletions(-) create mode 100644 tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_asset_reverse.txt create mode 100644 tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_asset_reverse.txt diff --git a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh index a9c2f51a0..137158455 100755 --- a/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh +++ b/tools/txn_forwarder/bubblegum_tests/run-bubblegum-sequences.sh @@ -1,5 +1,12 @@ #!/bin/bash +# Pass `reverse` to run scenarios in reverse. +if [ "$1" = "reverse" ]; then + REVERSE="true" +else + REVERSE="false" +fi + SCENARIOS=("mint_transfer_burn.scenario" \ "mint_redeem_decompress.scenario" "mint_redeem_cancel_redeem_redeem_decompress.scenario" \ @@ -19,14 +26,16 @@ TEST_SCENARIO_DATA_DIR="test_scenario_data" RED() { echo $'\e[1;31m'$1$'\e[0m'; } GRN() { echo $'\e[1;32m'$1$'\e[0m'; } -# Read from database using psql. +# Read from database using psql and compare to expected value. # $1 is SQL command. # $2 extra CLI args to send to psql. # $3 is expected value. # $4 is topic for the pass/fail message. -READ_FROM_DATABASE() { - DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana "$2" --command="$1") - DATABASE_VAL=$(sed '/^created_at/d' <<< "$DATABASE_VAL") +# Returns 0 if database value matches expected value, otherwise returns 1. +CHECK_DATABASE() { + local DATABASE_VAL=$(PGPASSWORD=solana psql -h localhost -U solana "$2" --command="$1") + # Remove `created_at` since the date changes for `asset` table entries. + local DATABASE_VAL=$(sed '/^created_at/d' <<< "$DATABASE_VAL") if [ "$3" = "$DATABASE_VAL" ]; then echo $(GRN "${SCENARIOS[$i]} $4 passed") >&2 return 0 @@ -35,17 +44,30 @@ READ_FROM_DATABASE() { echo "Asset ID: $ASSET_ID" >&2 echo "Expected:" >&2 echo "$3" >&2 + echo "" echo "Actual:" >&2 echo "$DATABASE_VAL" >&2 return 1 fi } -# Read in expected data from test data file. +# Read in expected data from test data file. If the $REVERSE flag is set to "true" then first +# look for a file with the `_reverse` suffix. If one does not exist, use the default filename +# for that suffix. # $1 is scenario file to use as a base name. # $2 is the suffix for the type of test data, i.e. "asset", "cl_items", etc. +# If successful, prints contents of file on stdout and returns 0, otherwise returns 1. READ_IN_EXPECTED_DATA() { - local EXPECTED_DATA_FILE="$TEST_SCENARIO_DATA_DIR/$(basename "$1" .scenario)_"$2".txt" + local BASE_NAME=$(basename "$1" .scenario) + if [ "$REVERSE" = "true" ]; then + local EXPECTED_DATA_FILE_BW="$TEST_SCENARIO_DATA_DIR/${BASE_NAME}_"$2"_reverse.txt" + if [ -f "$EXPECTED_DATA_FILE_BW" ]; then + cat "$EXPECTED_DATA_FILE_BW" + return 0 + fi + fi + + local EXPECTED_DATA_FILE="$TEST_SCENARIO_DATA_DIR/${BASE_NAME}_"$2".txt" if [ -f "$EXPECTED_DATA_FILE" ]; then cat "$EXPECTED_DATA_FILE" return 0 @@ -55,8 +77,10 @@ READ_IN_EXPECTED_DATA() { fi } -if [ ${#SCENARIOS[@]} -gt 0 ]; then - echo "Running ${#SCENARIOS[@]} scenarios" +if [ "$REVERSE" = "true" ]; then + echo "Running ${#SCENARIOS[@]} scenarios in reverse" +else + echo "Running ${#SCENARIOS[@]} scenarios forwards" fi # 0 is pass, 1 is fail. @@ -90,26 +114,35 @@ for i in ${!SCENARIOS[@]}; do # Initially this asset should not be in any database tables. ASSET_SQL="SELECT * FROM asset WHERE id = '$ASSET_ID';" - READ_FROM_DATABASE "$ASSET_SQL" "-x" "(0 rows)" "initial asset table state" || STATUS=1 + CHECK_DATABASE "$ASSET_SQL" "-x" "(0 rows)" "initial asset table state" || STATUS=1 ASSET_CREATORS_SQL="SELECT asset_id, creator, share, verified, seq, slot_updated, position \ FROM asset_creators \ WHERE asset_id = '$ASSET_ID' \ ORDER BY position;" - READ_FROM_DATABASE "$ASSET_CREATORS_SQL" "-x" "(0 rows)" "initial asset_creators table state" || STATUS=1 + CHECK_DATABASE "$ASSET_CREATORS_SQL" "-x" "(0 rows)" "initial asset_creators table state" || STATUS=1 ASSET_GROUPING_SQL="SELECT asset_id, group_key, group_value, seq, slot_updated, verified, group_info_seq \ FROM asset_grouping \ WHERE asset_id = '$ASSET_ID';" - READ_FROM_DATABASE "$ASSET_GROUPING_SQL" "-x" "(0 rows)" "initial asset_grouping table state" || STATUS=1 + CHECK_DATABASE "$ASSET_GROUPING_SQL" "-x" "(0 rows)" "initial asset_grouping table state" || STATUS=1 CL_ITEMS_SQL="select tree, node_idx, leaf_idx, seq, level, hash from cl_items where tree = '$TREE_ID' order by level;" - READ_FROM_DATABASE "$CL_ITEMS_SQL" "-x" "(0 rows)" "initial cl_items table state" || STATUS=1 + CHECK_DATABASE "$CL_ITEMS_SQL" "-x" "(0 rows)" "initial cl_items table state" || STATUS=1 # Run the scenario file that indexes the asset. These are done with separate calls to the `txn_forwarder` # in order to enforce order. Just calling the `txn_forwarder` with the file results in random ordering. readarray -t TXS < "$TEST_SCENARIO_DATA_DIR/${SCENARIOS[$i]}" + # Reverse transactions if necessary. + if [ "$REVERSE" = "true" ]; then + REVERSED_TXS=() + for ((j = ${#TXS[@]} - 1; j >= 0; j--)); do + REVERSED_TXS+=("${TXS[j]}") + done + TXS=("${REVERSED_TXS[@]}") + fi + for TX in ${TXS[@]}; do (cd .. && \ cargo run -- \ @@ -123,19 +156,24 @@ for i in ${!SCENARIOS[@]}; do sleep 2 # Asset should now be in the database and all fields match (except `created_at` in `asset`` table). - READ_FROM_DATABASE "$ASSET_SQL" "-x" "$EXPECTED_ASSET_VALUE" "asset table" || STATUS=1 - READ_FROM_DATABASE "$ASSET_CREATORS_SQL" "-x" "$EXPECTED_ASSET_CREATORS" "asset_creators table" || STATUS=1 - READ_FROM_DATABASE "$ASSET_GROUPING_SQL" "-x" "$EXPECTED_ASSET_GROUPING" "asset_grouping table" || STATUS=1 - READ_FROM_DATABASE "$CL_ITEMS_SQL" "" "$EXPECTED_CL_ITEMS" "cl_items table" || STATUS=1 + CHECK_DATABASE "$ASSET_SQL" "-x" "$EXPECTED_ASSET_VALUE" "asset table" || STATUS=1 + CHECK_DATABASE "$ASSET_CREATORS_SQL" "-x" "$EXPECTED_ASSET_CREATORS" "asset_creators table" || STATUS=1 + CHECK_DATABASE "$ASSET_GROUPING_SQL" "-x" "$EXPECTED_ASSET_GROUPING" "asset_grouping table" || STATUS=1 + CHECK_DATABASE "$CL_ITEMS_SQL" "" "$EXPECTED_CL_ITEMS" "cl_items table" || STATUS=1 echo "" done -echo "" +if [ "$REVERSE" = "true" ]; then + SUFFIX="IN REVERSE" +else + SUFFIX="FORWARDS" +fi + if [ $STATUS -eq 1 ]; then - echo $(RED "SOME TESTS FAILED!") + echo $(RED "SOME TESTS FAILED $SUFFIX!") else - echo $(GRN "ALL TESTS PASSED!") + echo $(GRN "ALL TESTS PASSED $SUFFIX!") fi exit $STATUS diff --git a/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_asset_reverse.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_asset_reverse.txt new file mode 100644 index 000000000..d0b1eaaef --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_cancel_redeem_redeem_decompress_asset_reverse.txt @@ -0,0 +1,28 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \x4302561a2799244936a3b020569bf90f58cd9b406af4cd084a82a2cf6415a8f0 +alt_id | +specification_version | +specification_asset_class | +owner | +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | \x4302561a2799244936a3b020569bf90f58cd9b406af4cd084a82a2cf6415a8f0 +compressed | f +compressible | f +seq | 0 +tree_id | +leaf | +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | +burnt | f +slot_updated | +data_hash | +creator_hash | +owner_delegate_seq | +leaf_seq | +base_info_seq | \ No newline at end of file diff --git a/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_asset_reverse.txt b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_asset_reverse.txt new file mode 100644 index 000000000..0b7b6deef --- /dev/null +++ b/tools/txn_forwarder/bubblegum_tests/test_scenario_data/mint_redeem_decompress_asset_reverse.txt @@ -0,0 +1,28 @@ +-[ RECORD 1 ]-------------+------------------------------------------------------------------- +id | \x4582ef313005487b924213937300a3c5cef8502646c8c182a2a9e1188adb196b +alt_id | +specification_version | +specification_asset_class | +owner | +owner_type | single +delegate | +frozen | f +supply | 1 +supply_mint | \x4582ef313005487b924213937300a3c5cef8502646c8c182a2a9e1188adb196b +compressed | f +compressible | f +seq | 0 +tree_id | +leaf | +nonce | 0 +royalty_target_type | creators +royalty_target | +royalty_amount | 0 +asset_data | +burnt | f +slot_updated | +data_hash | +creator_hash | +owner_delegate_seq | +leaf_seq | +base_info_seq | \ No newline at end of file From ddaa0e3b4cac1d7cd5cf4626e72af7603df5fa86 Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Thu, 4 Jan 2024 23:51:18 -0800 Subject: [PATCH 11/12] Add instructions to README for running test script --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e0b4d6d2b..13c81df34 100644 --- a/README.md +++ b/README.md @@ -96,17 +96,16 @@ Developing with Docker is much easier, but has some nuances to it. This test doc * Token 2022 * Latest version of the Associated token program -You need to run the following script (which takes a long time) in order to get all those .so files. +You need to run the following script in order to get all those .so files. ```bash -chmod +x ./prepare-local-docker-env.sh ./prepare-local-docker-env.sh ``` -This script grabs all the code for these programs and compiles it, and chucks it into your programs folder. Go grab some coffe because this will take a while/ -If you get some permissions errors, just sudo delete the programs directory and start again. +This script grabs all the code for these programs and downloads it to your programs folder. #### Authentication with Docker and AWS +_This step is not normally needed for basic local docker usage._ ```aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin {your aws container registry}``` #### Running the application @@ -129,6 +128,48 @@ Also when mucking about with the docker file if your gut tells you that somethin Sometimes you will want to delete the db do so with `sudo rm -rf db-data`. You can also delete the ledger with `sudo rm -rf ledger`. +#### Running Bubblegum Test Sequences + +While running the multi-container Docker application locally, you can run a script located in `tools/txn_forwarder/bubblegum_tests` that will send sequences of bubblegum transactions via the `txn_forwarder`, and then use `psql` to read and verify the indexing results in the local Postgres database. + +```bash +sudo rm -rf db-data/ +sudo rm -rf ledger/ +docker compose up --force-recreate --build +``` +_In another terminal:_ +```bash +cd tools/txn_forwarder/bubblegum_tests/ +./run-bubblegum-sequences.sh +``` + +You should see it log something like: +``` +Running 10 scenarios forwards +mint_transfer_burn.scenario initial asset table state passed +mint_transfer_burn.scenario initial asset_creators table state passed +mint_transfer_burn.scenario initial asset_grouping table state passed +mint_transfer_burn.scenario initial cl_items table state passed +... +mint_to_collection_unverify_collection.scenario asset table passed +mint_to_collection_unverify_collection.scenario asset_creators table passed +mint_to_collection_unverify_collection.scenario asset_grouping table passed +mint_to_collection_unverify_collection.scenario cl_items table passed + +ALL TESTS PASSED FORWARDS! +``` + +You can also run the sequences in reverse: +```bash +./run-bubblegum-sequences.sh reverse +``` +And after it runs you should see `ALL TESTS PASSED IN REVERSE!` + +A few detailed notes about this test script: +1. This script is not all-encompassing. It is only meant to automate some normal basic tests that were previously done manually. The reason this test is not added to CI is because requires a more powerful system to run the Docker application, which contains the no-vote Solana validator. +2. The test sequences are in `.scenario` files, but instead of sending those files to the `txn_forwarder` directly (which supports the file format), we parse them out and send them individually using the `single` parameter. This is because using the `.scenario` file directly results in random ordering of the transactions and we are explicity trying to test them going forwards and in reverse. +3. In general the expected database results are the same when running the transactions forwards and backwards. However, for assets that are decompressed, this is not true because we don't index some of the asset information from Bubblegum mint indexing if we already know the asset has been decompressed. We instead let Token Metadata account based indexing fill in that information. This is not reflected by this test script so the results differ when running these sequences in reverse. The differing results are reflected in test files with the `_reverse` suffix. + #### Logs To get a reasonable amount of logs while running Docker, direct grafana logs to a file: ``` @@ -138,7 +179,7 @@ grafana: ... - GF_LOG_MODE=file ``` -and set Solana Rust logs to error level: +and set Solana Rust logs to error level (it is already set to error level now in the current docker compose file): ``` solana: ... From e292276f068480e253f99f9994f1353e7c676315 Mon Sep 17 00:00:00 2001 From: Michael Danenberg <56533526+danenbm@users.noreply.github.com> Date: Fri, 5 Jan 2024 00:01:38 -0800 Subject: [PATCH 12/12] Minor README update --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 13c81df34..e9dbb9692 100644 --- a/README.md +++ b/README.md @@ -96,12 +96,12 @@ Developing with Docker is much easier, but has some nuances to it. This test doc * Token 2022 * Latest version of the Associated token program -You need to run the following script in order to get all those .so files. +You need to run the following script in order to get the .so files. ```bash ./prepare-local-docker-env.sh ``` -This script grabs all the code for these programs and downloads it to your programs folder. +This script downloads these programs from mainnet and puts them in the `programs/` folder. #### Authentication with Docker and AWS @@ -166,9 +166,9 @@ You can also run the sequences in reverse: And after it runs you should see `ALL TESTS PASSED IN REVERSE!` A few detailed notes about this test script: -1. This script is not all-encompassing. It is only meant to automate some normal basic tests that were previously done manually. The reason this test is not added to CI is because requires a more powerful system to run the Docker application, which contains the no-vote Solana validator. -2. The test sequences are in `.scenario` files, but instead of sending those files to the `txn_forwarder` directly (which supports the file format), we parse them out and send them individually using the `single` parameter. This is because using the `.scenario` file directly results in random ordering of the transactions and we are explicity trying to test them going forwards and in reverse. -3. In general the expected database results are the same when running the transactions forwards and backwards. However, for assets that are decompressed, this is not true because we don't index some of the asset information from Bubblegum mint indexing if we already know the asset has been decompressed. We instead let Token Metadata account based indexing fill in that information. This is not reflected by this test script so the results differ when running these sequences in reverse. The differing results are reflected in test files with the `_reverse` suffix. +* This script is not all-encompassing. It is only meant to automate some normal basic tests that were previously done manually. The reason this test is not added to CI is because requires a more powerful system to run the Docker application, which contains the no-vote Solana validator. +* The test sequences are in `.scenario` files, but instead of sending those files to the `txn_forwarder` directly (which supports the file format), we parse them out and send them individually using the `single` parameter. This is because using the `.scenario` file directly results in random ordering of the transactions and we are explicity trying to test them going forwards and in reverse. +* In general the expected database results are the same when running the transactions forwards and backwards. However, for assets that are decompressed, this is not true because we don't index some of the asset information from Bubblegum mint indexing if we already know the asset has been decompressed. We instead let Token Metadata account based indexing fill in that information. This is not reflected by this test script so the results differ when running these sequences in reverse. The differing results are reflected in test files with the `_reverse` suffix. #### Logs To get a reasonable amount of logs while running Docker, direct grafana logs to a file: