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: add other code template types #5242

Merged
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
8 changes: 8 additions & 0 deletions applications/tari_app_grpc/proto/sidechain_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,21 @@ message ConfidentialOutputData {
message TemplateType {
oneof template_type {
WasmInfo wasm = 1;
FlowInfo flow = 2;
ManifestInfo manifest = 3;
}
}

message WasmInfo {
uint32 abi_version = 1;
}

message FlowInfo {
}

message ManifestInfo {
}

message BuildInfo {
string repo_url = 1;
bytes commit_hash = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ impl TryFrom<grpc::TemplateType> for TemplateType {
grpc::template_type::TemplateType::Wasm(wasm) => Ok(TemplateType::Wasm {
abi_version: wasm.abi_version.try_into().map_err(|_| "abi_version overflowed")?,
}),
grpc::template_type::TemplateType::Flow(_flow) => Ok(TemplateType::Flow {}),
grpc::template_type::TemplateType::Manifest(_manifest) => Ok(TemplateType::Manifest {}),
}
}
}
Expand All @@ -192,6 +194,12 @@ impl From<TemplateType> for grpc::TemplateType {
abi_version: abi_version.into(),
})),
},
TemplateType::Flow => Self {
template_type: Some(grpc::template_type::TemplateType::Flow(grpc::FlowInfo {})),
},
TemplateType::Manifest => Self {
template_type: Some(grpc::template_type::TemplateType::Manifest(grpc::ManifestInfo {})),
},
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions base_layer/core/src/proto/sidechain_feature.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,22 @@ message ConfidentialOutputData {
message TemplateType {
oneof template_type {
WasmInfo wasm = 1;
FlowInfo flow = 2;
ManifestInfo manifest =3;
}
}
message WasmInfo {
uint32 abi_version = 1;
}

message FlowInfo {

}

message ManifestInfo {

}

message BuildInfo {
string repo_url = 1;
bytes commit_hash = 2;
Expand Down
12 changes: 12 additions & 0 deletions base_layer/core/src/proto/sidechain_feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ impl TryFrom<proto::types::TemplateType> for TemplateType {
proto::types::template_type::TemplateType::Wasm(wasm) => Ok(TemplateType::Wasm {
abi_version: wasm.abi_version.try_into().map_err(|_| "abi_version overflowed")?,
}),
proto::types::template_type::TemplateType::Flow(_flow) => Ok(TemplateType::Flow),
proto::types::template_type::TemplateType::Manifest(_manifest) => Ok(TemplateType::Manifest),
}
}
}
Expand All @@ -196,6 +198,16 @@ impl From<TemplateType> for proto::types::TemplateType {
},
)),
},
TemplateType::Flow => Self {
template_type: Some(proto::types::template_type::TemplateType::Flow(
proto::types::FlowInfo {},
)),
},
TemplateType::Manifest => Self {
template_type: Some(proto::types::template_type::TemplateType::Manifest(
proto::types::ManifestInfo {},
)),
},
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ pub struct CodeTemplateRegistration {
pub enum TemplateType {
/// Indicates that the template is a WASM module
Wasm { abi_version: u16 },
/// A flow template
Flow,
/// A manifest template
Manifest,
}

// -------------------------------- BuildInfo -------------------------------- //
Expand Down