Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix handling of candy machine config lines #672

Merged
merged 4 commits into from
Aug 25, 2022
Merged

Conversation

wbarksdale
Copy link
Contributor

@wbarksdale wbarksdale commented Aug 11, 2022

Candy machine config line parsing previously assumed that config line's were stored in their own PDA, however these config lines are actually stored as part of the candy machine account itself, but are not deserialized by mpl's candy machine data structure.

This implements a function to parse those config lines. The config lines are indexed based on a compound key (candy_machine_address, idx) where idx is the the index of the config line within the candy machine account data.

I also took a stab at adding a test for this, its not a super useful test, but wanted to give it a shot.
In order to make the test work, I needed to add a feature test-internal to expose the internals of the indexer to the test, this resulted in some changes to pre-push.sh and Cargo.toml. I'm happy to delete this test if its not wanted, but thought i'd take a stab at it.

@ray-kast ray-kast marked this pull request as draft August 11, 2022 20:17
@wbarksdale wbarksdale changed the base branch from dev to more-cm-fields August 11, 2022 20:21
@wbarksdale wbarksdale changed the title WIP: fix candy machine config lines fix handling of candy machine config lines Aug 12, 2022
@wbarksdale wbarksdale marked this pull request as ready for review August 12, 2022 21:15
Base automatically changed from more-cm-fields to dev August 12, 2022 22:25
Copy link
Contributor

@ray-kast ray-kast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking this on the unit test PR to avoid conflicting test bed scaffolding.

Copy link
Contributor

@ray-kast ray-kast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some TODOs that need resolving before this can merge, plus the dependency on #584.

@wbarksdale
Copy link
Contributor Author

@ray-kast I think I got everything, I left the data the test relies on in crates/indexer/tests/data because this seems to be the current_dir() for when the test is run. I also cleaned up the sql a bit, but for some reason it seemed to want the column rename to be in its own alter table, i'm not sure why, but let me know if you have any insight or want further changes there.

@wbarksdale wbarksdale requested a review from ray-kast August 17, 2022 17:39
@ray-kast ray-kast force-pushed the fix-cm-config-lines branch from 6358269 to a6cdd74 Compare August 17, 2022 19:27
ray-kast
ray-kast previously approved these changes Aug 17, 2022
Copy link
Contributor

@ray-kast ray-kast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I addressed the remaining TODO comments and cleaned up some style errors.

commit 6358269
Author: William Barksdale <[email protected]>
Date:   Wed Aug 17 12:42:12 2022 -0500

    remove data dir

commit 3b2dca0
Author: William Barksdale <[email protected]>
Date:   Wed Aug 17 12:29:17 2022 -0500

    fix prepush

commit 2624e83
Author: William Barksdale <[email protected]>
Date:   Wed Aug 17 12:27:44 2022 -0500

    must_use

commit 8249e30
Author: William Barksdale <[email protected]>
Date:   Wed Aug 17 12:22:06 2022 -0500

    more fixes

commit c37fefe
Author: William Barksdale <[email protected]>
Date:   Wed Aug 17 12:19:03 2022 -0500

    remove verbose

commit 0a4cb71
Author: William Barksdale <[email protected]>
Date:   Wed Aug 17 12:17:57 2022 -0500

    address feedback

commit 9b61df6
Author: William Barksdale <[email protected]>
Date:   Wed Aug 17 10:43:13 2022 -0500

    cleanup sql

commit a802812
Merge: 25290d1 2ee12fd
Author: William Barksdale <[email protected]>
Date:   Mon Aug 15 12:12:16 2022 -0500

    finish merge

commit 25290d1
Author: William Barksdale <[email protected]>
Date:   Fri Aug 12 15:44:30 2022 -0500

    run test as part of pre-push checks

commit 204cb3d
Author: William Barksdale <[email protected]>
Date:   Fri Aug 12 15:05:45 2022 -0500

    fix lint i think

commit 2471a73
Author: William Barksdale <[email protected]>
Date:   Fri Aug 12 14:58:12 2022 -0500

    make panic impossible

commit facf2a3
Author: William Barksdale <[email protected]>
Date:   Fri Aug 12 14:47:23 2022 -0500

    works in theory

commit 7ce3971
Author: William Barksdale <[email protected]>
Date:   Fri Aug 12 14:07:04 2022 -0500

    fix compile errors

commit 3c4dc2c
Merge: a74ad4a 265bb4d
Author: William Barksdale <[email protected]>
Date:   Fri Aug 12 14:04:23 2022 -0500

    Merge branch 'more-cm-fields' into fix-cm-config-lines

commit a74ad4a
Author: William Barksdale <[email protected]>
Date:   Fri Aug 12 14:04:10 2022 -0500

    update candy machine objects

commit 2d3f710
Author: William Barksdale <[email protected]>
Date:   Fri Aug 12 14:00:52 2022 -0500

    update config lines schema

commit c726b8a
Author: William Barksdale <[email protected]>
Date:   Fri Aug 12 13:17:56 2022 -0500

    delete account

commit 8dd8f06
Author: William Barksdale <[email protected]>
Date:   Fri Aug 12 12:39:51 2022 -0500

    save work

commit 73b2d90
Author: William Barksdale <[email protected]>
Date:   Fri Aug 12 10:53:13 2022 -0500

    save

commit 265bb4d
Author: William Barksdale <[email protected]>
Date:   Thu Aug 11 17:15:38 2022 -0500

    format

commit 568fa7c
Author: William Barksdale <[email protected]>
Date:   Thu Aug 11 17:02:16 2022 -0500

    add gate keeper config

commit 543aede
Author: William Barksdale <[email protected]>
Date:   Thu Aug 11 16:25:35 2022 -0500

    hex string

commit 8cbb2f1
Author: William Barksdale <[email protected]>
Date:   Thu Aug 11 15:52:31 2022 -0500

    stuff

commit d61aef6
Author: William Barksdale <[email protected]>
Date:   Thu Aug 11 15:44:49 2022 -0500

    save work

commit c95d939
Author: William Barksdale <[email protected]>
Date:   Thu Aug 11 14:55:30 2022 -0500

    depluralize

commit 422422b
Author: William Barksdale <[email protected]>
Date:   Thu Aug 11 14:46:48 2022 -0500

    add comment for API consumers

commit 1fc5631
Author: William Barksdale <[email protected]>
Date:   Thu Aug 11 14:39:09 2022 -0500

    whitelist mint settings work in theory

commit b179a88
Author: William Barksdale <[email protected]>
Date:   Thu Aug 11 14:21:42 2022 -0500

    candy machine end settings work in theory

commit 3273738
Author: William Barksdale <[email protected]>
Date:   Thu Aug 11 13:39:52 2022 -0500

    WIP: parse config lines

commit f4ea6ee
Author: William Barksdale <[email protected]>
Date:   Wed Aug 10 18:13:53 2022 -0500

    candy machine config lines

commit 8fcd95b
Author: William Barksdale <[email protected]>
Date:   Wed Aug 10 17:51:06 2022 -0500

    add collection pda

commit 92dc860
Author: William Barksdale <[email protected]>
Date:   Wed Aug 10 15:59:06 2022 -0500

    make getters

commit d3e3063
Author: William Barksdale <[email protected]>
Date:   Wed Aug 10 15:30:08 2022 -0500

    add creator data loader
Copy link
Contributor Author

@wbarksdale wbarksdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this locally and it is ingesting config lines

@ray-kast ray-kast merged commit c9e2276 into dev Aug 25, 2022
@ray-kast ray-kast deleted the fix-cm-config-lines branch August 25, 2022 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants