Skip to content

Commit

Permalink
fix: update contract and build script (#41)
Browse files Browse the repository at this point in the history
* fix: soldeer and build script improvements

* fix(ci): install foundry in ci
  • Loading branch information
Tjemmmic authored Dec 12, 2024
1 parent f6047b6 commit 68de70d
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/verify-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
PROJECT_NAME: blueprint-template
steps:
- uses: actions/checkout@v4
- uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- uses: JohnPeel/cargo-generate-action@main
with:
name: ${{ env.PROJECT_NAME }}
Expand Down
34 changes: 20 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ features = ["getrandom"]

[build-dependencies]
blueprint-metadata = "0.1.6"
# TODO: Replace with versioned release
blueprint-build-utils = { git = "https://github.com/tangle-network/gadget" }

[features]
default = ["std"]
Expand Down
4 changes: 4 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
fn main() {
println!("cargo:rerun-if-changed=src/main.rs");
blueprint_metadata::generate_json();

let contract_dirs: Vec<&str> = vec!["./contracts"];
blueprint_build_utils::soldeer_update();
blueprint_build_utils::build_contracts(contract_dirs);
}
15 changes: 8 additions & 7 deletions contracts/src/HelloBlueprint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ contract HelloBlueprint is BlueprintServiceManagerBase {
* @param operator The operator's details.
* @param _registrationInputs Inputs required for registration.
*/
function onRegister(bytes calldata operator, bytes calldata _registrationInputs)
function onRegister(
ServiceOperators.OperatorPreferences calldata operator,
bytes calldata _registrationInputs
)
public
payable
override
Expand All @@ -27,11 +30,9 @@ contract HelloBlueprint is BlueprintServiceManagerBase {
/**
* @dev Hook for service instance requests. Called when a user requests a service
* instance from the blueprint.
* @param serviceId The ID of the requested service.
* @param operators The operators involved in the service.
* @param _requestInputs Inputs required for the service request.
* @param params The parameters for the service request.
*/
function onRequest(uint64 serviceId, bytes[] calldata operators, bytes calldata _requestInputs)
function onRequest(ServiceOperators.RequestParams calldata params)
public
payable
override
Expand All @@ -46,15 +47,15 @@ contract HelloBlueprint is BlueprintServiceManagerBase {
* @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) sending the result.
* @param operator The operator sending the result in bytes format.
* @param _inputs Inputs used for the job execution.
* @param _outputs Outputs resulting from the job execution.
*/
function onJobResult(
uint64 serviceId,
uint8 job,
uint64 _jobCallId,
bytes calldata participant,
ServiceOperators.OperatorPreferences calldata operator,
bytes calldata _inputs,
bytes calldata _outputs
) public payable virtual override onlyFromRootChain {
Expand Down
5 changes: 2 additions & 3 deletions soldeer.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[[dependencies]]
name = "tnt-core"
version = "0.1.0"
source = "https://soldeer-revisions.s3.amazonaws.com/tnt-core/0_1_0_10-12-2024_20:51:20_tnt-core.zip"
checksum = "628b2475c4d629c1cb2578b41b2e10daa3711d711aa5f5b0dd6153959808620f"
integrity = "07e49929d89cefe2f075a4781a5e92d3f276b0de29c325c0cae9cddbc591e69e"
git = "https://github.com/tangle-network/tnt-core.git"
rev = "7ce2100bdb57472524a130488dace41a56cf3515"

0 comments on commit 68de70d

Please sign in to comment.