Skip to content

Commit aaa2e81

Browse files
committed
Fix delegate code example to match actual freenet-stdlib API
1 parent e63db19 commit aaa2e81

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

hugo-site/content/resources/manual/tutorial.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,17 +356,19 @@ struct Delegate;
356356
#[delegate]
357357
impl DelegateInterface for Delegate {
358358
fn process(
359-
_params: Parameters<'static>,
359+
_parameters: Parameters<'static>,
360360
_attested: Option<&'static [u8]>,
361-
messages: InboundDelegateMsg,
361+
message: InboundDelegateMsg,
362362
) -> Result<Vec<OutboundDelegateMsg>, DelegateError> {
363-
match messages {
364-
InboundDelegateMsg::UserResponse(response) => {
365-
// Handle user input
363+
match message {
364+
InboundDelegateMsg::ApplicationMessage(app_msg) => {
365+
// Handle messages from UI
366+
// app_msg.app - the contract instance ID
367+
// app_msg.payload - the message bytes
366368
Ok(vec![])
367369
}
368-
InboundDelegateMsg::ApplicationMessage(app_id, msg) => {
369-
// Handle messages from UI
370+
InboundDelegateMsg::GetSecretResponse(response) => {
371+
// Handle secret retrieval response
370372
Ok(vec![])
371373
}
372374
_ => Ok(vec![]),

0 commit comments

Comments
 (0)