Skip to content

Commit

Permalink
Fix flow-output (#180)
Browse files Browse the repository at this point in the history
* Fix flow-output

* More diagnostic

* Fix deps

* Update test files

* Update test files
  • Loading branch information
juchiast authored Dec 7, 2024
1 parent 41bf958 commit 715ec0b
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 1,302 deletions.
4 changes: 2 additions & 2 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 crates/cmds-solana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bundlr-sdk = { version = "=0.3.0", default-features = false, features = [

# branch: vendor
pyth-sdk-solana = { git = "https://github.com/space-operator/pyth-sdk-rs", rev = "84cc6fe07acbb8a81b216228be244bf039621560" }
jupiter-swap-api-client = { git = "https://github.com/jup-ag/jupiter-swap-api-client.git", package = "jupiter-swap-api-client"}
jupiter-swap-api-client = { git = "https://github.com/jup-ag/jupiter-swap-api-client.git", package = "jupiter-swap-api-client", rev = "e3c162b921f46eacc867ca9c55e7d610eefabe25"}

# anchor
anchor-lang = "=0.30.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/flow/src/command/flow_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl CommandTrait for FlowOutputCommand {

fn inputs(&self) -> Vec<Input> {
[Input {
name: "".into(),
name: self.rename.clone(),
type_bounds: [ValueType::Free].to_vec(),
required: true,
passthrough: false,
Expand Down
12 changes: 6 additions & 6 deletions crates/flow/src/flow_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ pub enum BuildGraphError {
EdgeSourceNotFound(NodeId),
#[error("node not found in partial_config: {:?}", .0)]
NodeNotFoundInPartialConfig(NodeId),
#[error("node {:?} has no input {:?}", .0.0, .0.1)]
NoInput((NodeId, String)),
#[error("node {:?} has no output {:?}", .0.0, .0.1)]
NoOutput((NodeId, String)),
#[error("node {:?}:{} has no input {:?}", .0.0, .1, .0.1)]
NoInput((NodeId, String), String),
#[error("node {:?}:{} has no output {:?}", .0.0, .1, .0.1)]
NoOutput((NodeId, String), String),
}

impl FlowGraph {
Expand Down Expand Up @@ -463,7 +463,7 @@ impl FlowGraph {
let required = n
.command
.input_is_required(&to.1)
.ok_or_else(|| BuildGraphError::NoInput(to.clone()))?;
.ok_or_else(|| BuildGraphError::NoInput(to.clone(), n.command.name()))?;
(n.idx, required)
}
};
Expand Down Expand Up @@ -494,7 +494,7 @@ impl FlowGraph {
let optional = n
.command
.output_is_optional(&from.1)
.ok_or_else(|| BuildGraphError::NoOutput(from.clone()))?;
.ok_or_else(|| BuildGraphError::NoOutput(from.clone(), n.command.name()))?;
(n.idx, optional)
}
};
Expand Down
2 changes: 1 addition & 1 deletion crates/flow/test_files/2_foreach.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
"sources": [],
"targets": [
{
"name": "",
"name": "output",
"type_bounds": ["free"],
"required": true,
"defaultValue": "",
Expand Down
4 changes: 2 additions & 2 deletions crates/flow/test_files/uneven_loop.json
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@
"sources": [],
"targets": [
{
"name": "",
"name": "1",
"type_bounds": ["free"],
"required": true,
"defaultValue": "",
Expand Down Expand Up @@ -678,7 +678,7 @@
"sources": [],
"targets": [
{
"name": "",
"name": "2",
"type_bounds": ["free"],
"required": true,
"defaultValue": "",
Expand Down
Loading

0 comments on commit 715ec0b

Please sign in to comment.