From e0eb15b8ed1d3e9993ba5be69c92d0fb08a3951d Mon Sep 17 00:00:00 2001 From: shekohex Date: Tue, 22 Oct 2024 15:56:43 +0300 Subject: [PATCH 1/2] chore: Update to latest tnt-core --- contracts/src/HelloBlueprint.sol | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/contracts/src/HelloBlueprint.sol b/contracts/src/HelloBlueprint.sol index aa0acfb..ba74829 100644 --- a/contracts/src/HelloBlueprint.sol +++ b/contracts/src/HelloBlueprint.sol @@ -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. @@ -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, @@ -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. From 55fdb7dfb4f201767cfb53ff8932879fb1562e9d Mon Sep 17 00:00:00 2001 From: shekohex Date: Tue, 22 Oct 2024 15:59:54 +0300 Subject: [PATCH 2/2] chore: add blueprint metadata --- Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 59e1c63..8f6e2f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,4 +33,7 @@ path = "src/lib.rs" [[bin]] name = "{{project-name}}" -path = "src/main.rs" \ No newline at end of file +path = "src/main.rs" + +[package.metadata.blueprint] +manager = { evm = "HelloBlueprint" }