Skip to content

Commit

Permalink
Add dockerUrl in ClientAppMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
chalex-eth committed Oct 10, 2024
1 parent d7e48d0 commit 78b2712
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion contracts/script/DeployTaskAndAppRegistry.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ contract DeployTaskAndAppRegistry is Script, Constants {
ClientAppMetadata({
name: "Ethereum Block Number",
description: "This task returns the current block number of the Ethereum network.",
logoUrl: ""
logoUrl: "",
dockerUrl: ""
})
);

Expand Down
1 change: 1 addition & 0 deletions contracts/src/ClientAppRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {Ownable} from "./Ownable.sol";
struct ClientAppMetadata {
string name;
string description;
string dockerUrl;
string logoUrl;
}

Expand Down
7 changes: 7 additions & 0 deletions contracts/test/ClientAppRegistry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ contract ClientAppRegistryTest is TestState {
ClientAppMetadata memory metadata = ClientAppMetadata({
name: "Test App",
description: "A test client application",
dockerUrl: "https://example.com/docker.png",
logoUrl: "https://example.com/logo.png"
});

Expand All @@ -27,13 +28,15 @@ contract ClientAppRegistryTest is TestState {
assertEq(storedMetadata.name, metadata.name);
assertEq(storedMetadata.description, metadata.description);
assertEq(storedMetadata.logoUrl, metadata.logoUrl);
assertEq(storedMetadata.dockerUrl, metadata.dockerUrl);
}

function testRegisterClientApp_RevertWhen_NotOwner() public {
bytes32 clientAppId = bytes32(uint256(1));
ClientAppMetadata memory metadata = ClientAppMetadata({
name: "Test App",
description: "A test client application",
dockerUrl: "https://example.com/docker.png",
logoUrl: "https://example.com/logo.png"
});

Expand All @@ -47,6 +50,7 @@ contract ClientAppRegistryTest is TestState {
ClientAppMetadata memory metadata = ClientAppMetadata({
name: "Test App",
description: "A test client application",
dockerUrl: "https://example.com/docker.png",
logoUrl: "https://example.com/logo.png"
});

Expand All @@ -63,6 +67,7 @@ contract ClientAppRegistryTest is TestState {
ClientAppMetadata memory metadata = ClientAppMetadata({
name: "Test App",
description: "A test client application",
dockerUrl: "https://example.com/docker.png",
logoUrl: "https://example.com/logo.png"
});

Expand All @@ -73,13 +78,15 @@ contract ClientAppRegistryTest is TestState {
assertEq(retrievedMetadata.name, metadata.name);
assertEq(retrievedMetadata.description, metadata.description);
assertEq(retrievedMetadata.logoUrl, metadata.logoUrl);
assertEq(retrievedMetadata.dockerUrl, metadata.dockerUrl);
}

function testIsClientApp() public {
bytes32 clientAppId = bytes32(uint256(1));
ClientAppMetadata memory metadata = ClientAppMetadata({
name: "Test App",
description: "A test client application",
dockerUrl: "https://example.com/docker.png",
logoUrl: "https://example.com/logo.png"
});

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/TaskRegistry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract TaskRegistryTest is TestState {
// Register client app
bytes32 appId = bytes32(uint256(1));
vm.prank(owner);
clientAppRegistry.registerClientApp(appId, ClientAppMetadata("Test APP", "Test App", "TEST"));
clientAppRegistry.registerClientApp(appId, ClientAppMetadata("Test APP", "Test App", "TEST", ""));
}

function testSetAggregatorNode() public {
Expand Down

0 comments on commit 78b2712

Please sign in to comment.