Skip to content

Commit

Permalink
Move find_model_with_retry and use in mpl-core (#181)
Browse files Browse the repository at this point in the history
* Move find_model_with_retry and use in mpl-core to fix loop

* Update blockbuster which includes new mpl-core lib

* Update integration tests
  • Loading branch information
danenbm authored Mar 28, 2024
1 parent 2627055 commit 2f5bc5f
Show file tree
Hide file tree
Showing 31 changed files with 111 additions and 126 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ anyhow = "1.0.75"
async-std = "1.0.0"
async-trait = "0.1.60"
backon = "0.4.1"
blockbuster = "2.1.0"
blockbuster = "2.2.0"
borsh = "~0.10.3"
borsh-derive = "~0.10.3"
bs58 = "0.4.0"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
28 changes: 14 additions & 14 deletions integration_tests/tests/integration_tests/mpl_core_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ async fn test_mpl_core_get_asset() {
)
.await;

let seeds: Vec<SeedEvent> = seed_accounts(["JCPjxuL4abG7M7NDtKUt1ekh3jg1FJLW6n1G92TUpoA4"]);
let seeds: Vec<SeedEvent> = seed_accounts(["x3hJtpU4AUsGejNvxzX9TKjcyNB1eYtDdDPWdeF6opr"]);

apply_migrations_and_delete_data(setup.db.clone()).await;
index_seed_events(&setup, seeds.iter().collect_vec()).await;

let request = r#"
{
"id": "JCPjxuL4abG7M7NDtKUt1ekh3jg1FJLW6n1G92TUpoA4"
"id": "x3hJtpU4AUsGejNvxzX9TKjcyNB1eYtDdDPWdeF6opr"
}
"#;

Expand All @@ -50,14 +50,14 @@ async fn test_mpl_core_get_collection() {
)
.await;

let seeds: Vec<SeedEvent> = seed_accounts(["AVyNtmNdLAbxyzPDbaeJjpVJSPb5vtyido8NzyKKuVjQ"]);
let seeds: Vec<SeedEvent> = seed_accounts(["DHciVfQxHHM7t2asQJRjjkKbjvZ4PuG3Y3uiULMQUjJQ"]);

apply_migrations_and_delete_data(setup.db.clone()).await;
index_seed_events(&setup, seeds.iter().collect_vec()).await;

let request = r#"
{
"id": "AVyNtmNdLAbxyzPDbaeJjpVJSPb5vtyido8NzyKKuVjQ"
"id": "DHciVfQxHHM7t2asQJRjjkKbjvZ4PuG3Y3uiULMQUjJQ"
}
"#;

Expand All @@ -80,8 +80,8 @@ async fn test_mpl_core_get_assets_by_authority() {
.await;

let seeds: Vec<SeedEvent> = seed_accounts([
"6pELUa5FjLvw4TRM32opiT6vL74B8W3fwCwRkPUt857",
"HsDL2AYtoAHZyfFKyQp6pHGKaBRBZQZDVBAT1XwbP4d5",
"9CSyGBw1DCVZfx621nb7UBM9SpVDsX1m9MaN6APCf1Ci",
"4FcFVJVPRsYoMjt8ewDGV5nipoK63SNrJzjrBHyXvhcz",
]);

apply_migrations_and_delete_data(setup.db.clone()).await;
Expand Down Expand Up @@ -122,10 +122,10 @@ async fn test_mpl_core_get_assets_by_group() {
.await;

let seeds: Vec<SeedEvent> = seed_accounts([
"6Wp9xk6GrD4EmDKuD7fr2URJubjtGq5MXENR9UU15C9i",
"3YhJuW9X9Hvf4MVv5qP5xWxEMPrQu8uTwjkKR1q7D1gh",
"79Npv5WTGGkfVc4QYhmnz9xRUbCPV4g5aNKvotvGo4Ko",
"9qS8Xo1M3RUqvrLwd5RaA6iMbzh9An7nwDSDe1aB5mtr",
"JChzyyp1CnNz56tJLteQ5BsbngmWQ3JwcxLZrmuQA5b7",
"kTMCCKLTaZsnSReer12HsciwScUwhHyZyd9D9BwQF8k",
"EgzsppfYJmUet4ve8MnuHMyvSnj6R7LRmwsGEH5TuGhB",
"J2kazVRuZ33Po4PVyZGxiDYUMQ1eZiT5Xa13usRYo264",
]);

apply_migrations_and_delete_data(setup.db.clone()).await;
Expand All @@ -134,7 +134,7 @@ async fn test_mpl_core_get_assets_by_group() {
let request = r#"
{
"groupKey": "collection",
"groupValue": "6Wp9xk6GrD4EmDKuD7fr2URJubjtGq5MXENR9UU15C9i",
"groupValue": "JChzyyp1CnNz56tJLteQ5BsbngmWQ3JwcxLZrmuQA5b7",
"sortBy": {
"sortBy": "updated",
"sortDirection": "asc"
Expand Down Expand Up @@ -163,16 +163,16 @@ async fn test_mpl_core_get_assets_by_owner() {
.await;

let seeds: Vec<SeedEvent> = seed_accounts([
"EhtDFvn8oW5Vod5R37FF4uKStZCkJoMbTndsqXadMr5m",
"5Bwtqmss9BY4L5ENpf2mPHUNjzmWht7Pni1tepAhvHrc",
"4FFhh184GNqh3LEK8UhMY7KBuCdNvvhU7C23ZKrKnofb",
"9tsHoBrkSqBW5uMxKZyvxL6m9CCaz1a7sGEg8SuckUj",
]);

apply_migrations_and_delete_data(setup.db.clone()).await;
index_seed_events(&setup, seeds.iter().collect_vec()).await;

let request = r#"
{
"ownerAddress": "9NfyMp6tTdgPShA34N1KNEiX4A1iCzGpXKeG6jBfatiZ",
"ownerAddress": "7uScVQiT4vArB88dHrZoeVKWbtsRJmNp9r5Gce5VQpXS",
"sortBy": {
"sortBy": "updated",
"sortDirection": "asc"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
source: integration_tests/tests/integration_tests/mpl_core_tests.rs
assertion_line: 66
assertion_line: 37
expression: response
---
{
"interface": "MplCoreAsset",
"id": "JCPjxuL4abG7M7NDtKUt1ekh3jg1FJLW6n1G92TUpoA4",
"id": "x3hJtpU4AUsGejNvxzX9TKjcyNB1eYtDdDPWdeF6opr",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://example.com/asset",
Expand Down Expand Up @@ -37,7 +37,7 @@ expression: response
"grouping": [
{
"group_key": "collection",
"group_value": "AVyNtmNdLAbxyzPDbaeJjpVJSPb5vtyido8NzyKKuVjQ"
"group_value": "DHciVfQxHHM7t2asQJRjjkKbjvZ4PuG3Y3uiULMQUjJQ"
}
],
"royalty": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: integration_tests/tests/integration_tests/mpl_core_tests.rs
assertion_line: 149
assertion_line: 108
expression: response
---
{
Expand All @@ -9,14 +9,14 @@ expression: response
"page": 1,
"items": [
{
"interface": "MplCoreCollection",
"id": "6pELUa5FjLvw4TRM32opiT6vL74B8W3fwCwRkPUt857",
"interface": "MplCoreAsset",
"id": "4FcFVJVPRsYoMjt8ewDGV5nipoK63SNrJzjrBHyXvhcz",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://example.com/collection",
"json_uri": "https://example.com/asset",
"files": [],
"metadata": {
"name": "Test Collection",
"name": "Test Asset",
"symbol": ""
},
"links": {}
Expand All @@ -39,7 +39,12 @@ expression: response
"seq": 0,
"leaf_id": 0
},
"grouping": [],
"grouping": [
{
"group_key": "collection",
"group_value": "9CSyGBw1DCVZfx621nb7UBM9SpVDsX1m9MaN6APCf1Ci"
}
],
"royalty": {
"royalty_model": "creators",
"target": null,
Expand All @@ -54,27 +59,25 @@ expression: response
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "APrZTeVysBJqAznfLXS71NAzjr2fCVTSF1A66MeErzM7"
"owner": "GzYvuu9aUYXmnardj4svbAcCNmefiaGu2E3knGw9NJQQ"
},
"supply": null,
"mutable": true,
"burnt": false,
"plugins": {},
"mpl_core_info": {
"num_minted": 1,
"current_size": 1,
"plugins_json_version": 1
}
},
{
"interface": "MplCoreAsset",
"id": "HsDL2AYtoAHZyfFKyQp6pHGKaBRBZQZDVBAT1XwbP4d5",
"interface": "MplCoreCollection",
"id": "9CSyGBw1DCVZfx621nb7UBM9SpVDsX1m9MaN6APCf1Ci",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://example.com/asset",
"json_uri": "https://example.com/collection",
"files": [],
"metadata": {
"name": "Test Asset",
"name": "Test Collection",
"symbol": ""
},
"links": {}
Expand All @@ -97,12 +100,7 @@ expression: response
"seq": 0,
"leaf_id": 0
},
"grouping": [
{
"group_key": "collection",
"group_value": "6pELUa5FjLvw4TRM32opiT6vL74B8W3fwCwRkPUt857"
}
],
"grouping": [],
"royalty": {
"royalty_model": "creators",
"target": null,
Expand All @@ -117,13 +115,15 @@ expression: response
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "3R3QGnfGJZZ8MKWCxChNYaLf429uDfHrnaULDeajRgi5"
"owner": "APrZTeVysBJqAznfLXS71NAzjr2fCVTSF1A66MeErzM7"
},
"supply": null,
"mutable": true,
"burnt": false,
"plugins": {},
"mpl_core_info": {
"num_minted": 1,
"current_size": 1,
"plugins_json_version": 1
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: integration_tests/tests/integration_tests/mpl_core_tests.rs
assertion_line: 107
assertion_line: 149
expression: response
---
{
Expand All @@ -10,7 +10,7 @@ expression: response
"items": [
{
"interface": "MplCoreAsset",
"id": "3YhJuW9X9Hvf4MVv5qP5xWxEMPrQu8uTwjkKR1q7D1gh",
"id": "kTMCCKLTaZsnSReer12HsciwScUwhHyZyd9D9BwQF8k",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://example.com/asset",
Expand Down Expand Up @@ -42,7 +42,7 @@ expression: response
"grouping": [
{
"group_key": "collection",
"group_value": "6Wp9xk6GrD4EmDKuD7fr2URJubjtGq5MXENR9UU15C9i"
"group_value": "JChzyyp1CnNz56tJLteQ5BsbngmWQ3JwcxLZrmuQA5b7"
}
],
"royalty": {
Expand Down Expand Up @@ -71,7 +71,7 @@ expression: response
},
{
"interface": "MplCoreAsset",
"id": "79Npv5WTGGkfVc4QYhmnz9xRUbCPV4g5aNKvotvGo4Ko",
"id": "EgzsppfYJmUet4ve8MnuHMyvSnj6R7LRmwsGEH5TuGhB",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://example.com/asset",
Expand Down Expand Up @@ -103,7 +103,7 @@ expression: response
"grouping": [
{
"group_key": "collection",
"group_value": "6Wp9xk6GrD4EmDKuD7fr2URJubjtGq5MXENR9UU15C9i"
"group_value": "JChzyyp1CnNz56tJLteQ5BsbngmWQ3JwcxLZrmuQA5b7"
}
],
"royalty": {
Expand Down Expand Up @@ -132,7 +132,7 @@ expression: response
},
{
"interface": "MplCoreAsset",
"id": "9qS8Xo1M3RUqvrLwd5RaA6iMbzh9An7nwDSDe1aB5mtr",
"id": "J2kazVRuZ33Po4PVyZGxiDYUMQ1eZiT5Xa13usRYo264",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://example.com/asset",
Expand Down Expand Up @@ -164,7 +164,7 @@ expression: response
"grouping": [
{
"group_key": "collection",
"group_value": "6Wp9xk6GrD4EmDKuD7fr2URJubjtGq5MXENR9UU15C9i"
"group_value": "JChzyyp1CnNz56tJLteQ5BsbngmWQ3JwcxLZrmuQA5b7"
}
],
"royalty": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ expression: response
"items": [
{
"interface": "MplCoreAsset",
"id": "5Bwtqmss9BY4L5ENpf2mPHUNjzmWht7Pni1tepAhvHrc",
"id": "9tsHoBrkSqBW5uMxKZyvxL6m9CCaz1a7sGEg8SuckUj",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://example.com/asset",
Expand Down Expand Up @@ -42,7 +42,7 @@ expression: response
"grouping": [
{
"group_key": "collection",
"group_value": "EhtDFvn8oW5Vod5R37FF4uKStZCkJoMbTndsqXadMr5m"
"group_value": "4FFhh184GNqh3LEK8UhMY7KBuCdNvvhU7C23ZKrKnofb"
}
],
"royalty": {
Expand All @@ -59,7 +59,7 @@ expression: response
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "9NfyMp6tTdgPShA34N1KNEiX4A1iCzGpXKeG6jBfatiZ"
"owner": "7uScVQiT4vArB88dHrZoeVKWbtsRJmNp9r5Gce5VQpXS"
},
"supply": null,
"mutable": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
source: integration_tests/tests/integration_tests/mpl_core_tests.rs
assertion_line: 37
assertion_line: 66
expression: response
---
{
"interface": "MplCoreCollection",
"id": "AVyNtmNdLAbxyzPDbaeJjpVJSPb5vtyido8NzyKKuVjQ",
"id": "DHciVfQxHHM7t2asQJRjjkKbjvZ4PuG3Y3uiULMQUjJQ",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://example.com/collection",
Expand Down Expand Up @@ -56,12 +56,14 @@ expression: response
"burnt": false,
"plugins": {
"update_delegate": {
"data": {},
"data": {
"additional_delegates": []
},
"index": 0,
"offset": 103,
"authority": {
"type": "Address",
"address": "GKF1wG5rUTYgnrbvyrxA6Zpt35UNY836KrwjApxdgmw9"
"address": "BpEw34ZXHm9TeqnPbcsHZJnx7StGa3GxBkZ3uTD9scfZ"
}
}
},
Expand Down
Loading

0 comments on commit 2f5bc5f

Please sign in to comment.