Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 70 additions & 16 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ litesvm = { version = "0.8.1", features = ["nodejs-internal"] }
litesvm-token = "0.8.1"
log = "0.4.27"
mime_guess = { version = "2.0.4", default-features = false }
mpl-core = { git = "https://github.com/ivsop/mpl-core", rev = "27bbab1997fdd39fd010d78406cc7ee2e7e2601d", default-features = false, features = ["serde"] }
mustache = "0.9.0"
notify = { version = "8.0.0", default-features = false }
npm_rs = "1.0.0"
Expand Down
1 change: 1 addition & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ libloading = { workspace = true }
litesvm = { workspace = true }
litesvm-token = { workspace = true }
log = { workspace = true }
mpl-core = { workspace = true}
reqwest = { workspace = true }
serde = { workspace = true }
serde_derive = { workspace = true } # must match the serde version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251
Expand Down
40 changes: 40 additions & 0 deletions crates/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,20 @@ impl SurfpoolError {
Self(error)
}

pub fn invalid_account_type<P, M>(pubkey: P, message: Option<M>) -> Self
where
P: Display,
M: Display,
{
let base_msg = format!("invalid account type {pubkey}");
let full_msg = if let Some(msg) = message {
format!("{base_msg}: {msg}")
} else {
base_msg
};
Self(Error::invalid_params(full_msg))
}

pub fn invalid_account_owner<P, M>(pubkey: P, message: Option<M>) -> Self
where
P: Display,
Expand Down Expand Up @@ -446,4 +460,30 @@ impl SurfpoolError {
error.message = format!("Expected profile not found for key {key}");
Self(error)
}

pub fn update_core_asset_error<T>(pubkey: Pubkey, e: T) -> Self
where
T: ToString,
{
let mut error = Error::internal_error();
error.data = Some(json!(format!(
"Error updating core asset {}: {}",
pubkey,
e.to_string()
)));
Self(error)
}

pub fn update_core_collection_error<T>(pubkey: Pubkey, e: T) -> Self
where
T: ToString,
{
let mut error = Error::internal_error();
error.data = Some(json!(format!(
"Error updating core collection {}: {}",
pubkey,
e.to_string()
)));
Self(error)
}
}
Loading