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
2 changes: 1 addition & 1 deletion 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 addons/svm/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "txtx-addon-network-svm"
description = "Primitives for executing Solana runbooks"
version = "0.3.21"
version = "0.3.22"
edition = { workspace = true }
license = "Apache-2.0"
repository = { workspace = true }
Expand Down
37 changes: 0 additions & 37 deletions addons/svm/core/src/templates/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use crate::codec::idl::IdlRef;
use convert_case::{Case, Casing};
use serde::{Deserialize, Serialize};

pub fn get_interpolated_header_template(title: &str) -> String {
Expand Down Expand Up @@ -146,41 +144,6 @@ action "deploy_{}" "svm::deploy_program" {{
);
}

pub fn get_interpolated_anchor_subgraph_template(
program_name: &str,
idl_str: &str,
) -> Result<Option<String>, String> {
let idl =
IdlRef::from_str(idl_str).map_err(|e| format!("failed to parse program idl: {e}"))?.idl;

let subgraph_runbook = if idl.events.is_empty() {
None
} else {
Some(
idl.events
.iter()
.map(|event| {
let event_slug = Casing::to_case(&event.name, Case::Snake);
format!(
r#"
action "{program_name}_{event_slug}" "svm::deploy_subgraph" {{
program_id = action.deploy_{program_name}.program_id
program_idl = action.deploy_{program_name}.program_idl
block_height = 0 // action.deploy_{program_name}.block_height
event {{
name = "{}"
}}
}}"#,
event.name,
)
})
.collect::<Vec<_>>()
.join("\n"),
)
};
Ok(subgraph_runbook)
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GenesisEntry {
// Base58 pubkey string.
Expand Down
Loading