Skip to content

Commit b5fafbe

Browse files
committed
feat: generate mpl-token-metadata decoder with tests
1 parent e93578d commit b5fafbe

File tree

97 files changed

+1572
-1141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1572
-1141
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

decoders/mpl-token-metadata-decoder/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ crate-type = ["rlib"]
1414

1515
[dependencies]
1616
carbon-core = { workspace = true }
17-
serde = { workspace = true }
1817
solana-account = { workspace = true }
19-
solana-instruction = { workspace = true, default-features = false }
18+
solana-instruction = { workspace = true }
2019
solana-pubkey = { workspace = true }
20+
serde = { workspace = true }
21+
22+
[dev-dependencies]
23+
carbon-test-utils = { workspace = true }

decoders/mpl-token-metadata-decoder/src/accounts/collection_authority_record.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use {
2-
super::super::types::*,
3-
carbon_core::{borsh, CarbonDeserialize},
4-
};
1+
use super::super::types::*;
52

6-
#[derive(CarbonDeserialize, Debug)]
3+
use carbon_core::{borsh, CarbonDeserialize};
4+
5+
#[derive(CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize)]
6+
#[carbon(discriminator = "0x9c306c1fd4db64a8")]
77
pub struct CollectionAuthorityRecord {
88
pub key: Key,
99
pub bump: u8,

decoders/mpl-token-metadata-decoder/src/accounts/edition.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use {
2-
super::super::types::*,
3-
carbon_core::{borsh, CarbonDeserialize},
4-
};
1+
use super::super::types::*;
52

6-
#[derive(CarbonDeserialize, Debug)]
3+
use carbon_core::{borsh, CarbonDeserialize};
4+
5+
#[derive(CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize)]
6+
#[carbon(discriminator = "0xea75f94a0763eba7")]
77
pub struct Edition {
88
pub key: Key,
99
pub parent: solana_pubkey::Pubkey,

decoders/mpl-token-metadata-decoder/src/accounts/edition_marker.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use {
2-
super::super::types::*,
3-
carbon_core::{borsh, CarbonDeserialize},
4-
};
1+
use super::super::types::*;
52

6-
#[derive(CarbonDeserialize, Debug)]
3+
use carbon_core::{borsh, CarbonDeserialize};
4+
5+
#[derive(CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize)]
6+
#[carbon(discriminator = "0xe90a12e681ac25ea")]
77
pub struct EditionMarker {
88
pub key: Key,
99
pub ledger: [u8; 31],

decoders/mpl-token-metadata-decoder/src/accounts/edition_marker_v2.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use {
2-
super::super::types::*,
3-
carbon_core::{borsh, CarbonDeserialize},
4-
};
1+
use super::super::types::*;
52

6-
#[derive(CarbonDeserialize, Debug)]
3+
use carbon_core::{borsh, CarbonDeserialize};
4+
5+
#[derive(CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize)]
6+
#[carbon(discriminator = "0x837b3cfb2d02546e")]
77
pub struct EditionMarkerV2 {
88
pub key: Key,
99
pub ledger: Vec<u8>,

decoders/mpl-token-metadata-decoder/src/accounts/holder_delegate_record.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use {
2-
super::super::types::*,
3-
carbon_core::{borsh, CarbonDeserialize},
4-
};
1+
use super::super::types::*;
52

6-
#[derive(CarbonDeserialize, Debug)]
3+
use carbon_core::{borsh, CarbonDeserialize};
4+
5+
#[derive(CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize)]
6+
#[carbon(discriminator = "0x64e843a0effc0637")]
77
pub struct HolderDelegateRecord {
88
pub key: Key,
99
pub bump: u8,

decoders/mpl-token-metadata-decoder/src/accounts/master_edition_v1.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use {
2-
super::super::types::*,
3-
carbon_core::{borsh, CarbonDeserialize},
4-
};
1+
use super::super::types::*;
52

6-
#[derive(CarbonDeserialize, Debug)]
3+
use carbon_core::{borsh, CarbonDeserialize};
4+
5+
#[derive(CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize)]
6+
#[carbon(discriminator = "0x4fa529a7b4bf8db9")]
77
pub struct MasterEditionV1 {
88
pub key: Key,
99
pub supply: u64,

decoders/mpl-token-metadata-decoder/src/accounts/master_edition_v2.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use {
2-
super::super::types::*,
3-
carbon_core::{borsh, CarbonDeserialize},
4-
};
1+
use super::super::types::*;
52

6-
#[derive(CarbonDeserialize, Debug)]
3+
use carbon_core::{borsh, CarbonDeserialize};
4+
5+
#[derive(CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize)]
6+
#[carbon(discriminator = "0x653ba3cfee10aa9f")]
77
pub struct MasterEditionV2 {
88
pub key: Key,
99
pub supply: u64,

decoders/mpl-token-metadata-decoder/src/accounts/metadata.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use {
2-
super::super::types::*,
3-
carbon_core::{borsh, CarbonDeserialize},
4-
};
1+
use super::super::types::*;
52

6-
#[derive(CarbonDeserialize, Debug)]
3+
use carbon_core::{borsh, CarbonDeserialize};
4+
5+
#[derive(CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize)]
6+
#[carbon(discriminator = "0x480b791a6fb5555d")]
77
pub struct Metadata {
88
pub key: Key,
99
pub update_authority: solana_pubkey::Pubkey,

0 commit comments

Comments
 (0)