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

chore: Update to latest tnt-core #23

Merged
merged 3 commits into from
Oct 22, 2024
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
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ path = "src/lib.rs"

[[bin]]
name = "{{project-name}}"
path = "src/main.rs"
path = "src/main.rs"

[package.metadata.blueprint]
manager = { evm = "HelloBlueprint" }
31 changes: 4 additions & 27 deletions contracts/src/HelloBlueprint.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// SPDX-License-Identifier: UNLICENSE
pragma solidity >=0.8.13;

import "core/BlueprintServiceManager.sol";
import "core/BlueprintServiceManagerBase.sol";

/**
* @title HelloBlueprint
* @dev This contract is an example of a service blueprint that provides a single service.
* @note For all supported hooks, check the `BlueprintServiceManagerBase` contract.
*/
contract HelloBlueprint is BlueprintServiceManager {
contract HelloBlueprint is BlueprintServiceManagerBase {
/**
* @dev Hook for service operator registration. Called when a service operator
* attempts to register with the blueprint.
Expand Down Expand Up @@ -49,7 +50,7 @@ contract HelloBlueprint is BlueprintServiceManager {
* @param _inputs Inputs used for the job execution.
* @param _outputs Outputs resulting from the job execution.
*/
function onJobCallResult(
function onJobResult(
uint64 serviceId,
uint8 job,
uint64 _jobCallId,
Expand All @@ -60,30 +61,6 @@ contract HelloBlueprint is BlueprintServiceManager {
// Do something with the job call result
}

/**
* @dev Verifies the result of a job call. This function is used to validate the
* outputs of a job execution against the expected results.
* @param serviceId The ID of the service related to the job.
* @param job The job identifier.
* @param jobCallId The unique ID for the job call.
* @param participant The participant (operator) whose result is being verified.
* @param inputs Inputs used for the job execution.
* @param outputs Outputs resulting from the job execution.
* @return bool Returns true if the job call result is verified successfully,
* otherwise false.
*/
function verifyJobCallResult(
uint64 serviceId,
uint8 job,
uint64 jobCallId,
bytes calldata participant,
bytes calldata inputs,
bytes calldata outputs
) public view virtual override onlyFromRootChain returns (bool) {
// Verify the job call result here
return true;
}

/**
* @dev Converts a public key to an operator address.
* @param publicKey The public key to convert.
Expand Down