@@ -19,11 +19,40 @@ sol! {
1919 bytes32 requestHash,
2020 uint64 snapshotId
2121 ) external;
22+
23+ function validationResponse(
24+ bytes32 requestHash,
25+ uint8 response,
26+ string calldata responseURI,
27+ bytes32 responseHash,
28+ string calldata tag
29+ ) external;
30+
31+ event ValidationRequest (
32+ address indexed validatorAddress,
33+ uint256 indexed agentId,
34+ string requestURI,
35+ bytes32 indexed requestHash
36+ ) ;
37+
38+ event ValidationResponse (
39+ address indexed validatorAddress,
40+ uint256 indexed agentId,
41+ bytes32 indexed requestHash,
42+ uint8 response,
43+ string responseURI,
44+ bytes32 responseHash,
45+ string tag
46+ ) ;
2247 }
2348}
2449
2550use ValidationRegistryUpgradeable :: ValidationRegistryUpgradeableInstance ;
2651
52+ // Event type re-exports
53+ pub type ValidationRequestEvent = ValidationRegistryUpgradeable :: ValidationRequest ;
54+ pub type ValidationResponseEvent = ValidationRegistryUpgradeable :: ValidationResponse ;
55+
2756/// Client for interacting with the ValidationRegistryUpgradeable contract.
2857#[ derive( Clone ) ]
2958pub struct ValidationRegistryClient < P : Provider + Clone > {
@@ -82,4 +111,30 @@ impl<P: Provider + Clone> ValidationRegistryClient<P> {
82111 ) ;
83112 self . submitter . invoke ( "validationRequest" , call) . await
84113 }
114+
115+ /// Submit a validation response.
116+ ///
117+ /// # Arguments
118+ /// * `request_hash` - The request hash identifying the validation request
119+ /// * `response` - Response value 0-100 (0=invalid, 100=valid)
120+ /// * `response_uri` - Optional URI pointing to response details
121+ /// * `response_hash` - Hash of the response data (can be zero)
122+ /// * `tag` - Tag identifying the response source (e.g., "heartbeat")
123+ pub async fn validation_response (
124+ & self ,
125+ request_hash : B256 ,
126+ response : u8 ,
127+ response_uri : String ,
128+ response_hash : B256 ,
129+ tag : String ,
130+ ) -> Result < B256 > {
131+ let call = self . contract . validationResponse (
132+ request_hash,
133+ response,
134+ response_uri,
135+ response_hash,
136+ tag,
137+ ) ;
138+ self . submitter . invoke ( "validationResponse" , call) . await
139+ }
85140}
0 commit comments