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

feat(torii-grpc): add list to member value enum for usage in sdk #2828

Merged
merged 2 commits into from
Dec 23, 2024
Merged
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
9 changes: 9 additions & 0 deletions crates/torii/grpc/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
pub enum MemberValue {
Primitive(Primitive),
String(String),
List(Vec<MemberValue>),
}

#[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)]
Expand Down Expand Up @@ -418,6 +419,14 @@
member_value::ValueType::Primitive(primitive.into())
}
MemberValue::String(string) => member_value::ValueType::String(string),
MemberValue::List(list) => {
member_value::ValueType::List(proto::types::MemberValueList {
values: list
.into_iter()
.map(|v| proto::types::MemberValue { value_type: Some(v.into()) })
.collect(),
})

Check warning on line 428 in crates/torii/grpc/src/types/mod.rs

View check run for this annotation

Codecov / codecov/patch

crates/torii/grpc/src/types/mod.rs#L422-L428

Added lines #L422 - L428 were not covered by tests
}
}
}
}
Expand Down
Loading