Skip to content

Commit 2f61380

Browse files
committed
add domain_vk query
1 parent 29f9ee2 commit 2f61380

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

contracts/middleware/verification/sp1-verifier/schema/valence-sp1-verifier.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@
6565
}
6666
},
6767
"additionalProperties": false
68+
},
69+
{
70+
"type": "object",
71+
"required": [
72+
"domain_vk"
73+
],
74+
"properties": {
75+
"domain_vk": {
76+
"type": "object",
77+
"additionalProperties": false
78+
}
79+
},
80+
"additionalProperties": false
6881
}
6982
],
7083
"definitions": {
@@ -77,6 +90,12 @@
7790
"migrate": null,
7891
"sudo": null,
7992
"responses": {
93+
"domain_vk": {
94+
"$schema": "http://json-schema.org/draft-07/schema#",
95+
"title": "Binary",
96+
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
97+
"type": "string"
98+
},
8099
"verify": {
81100
"$schema": "http://json-schema.org/draft-07/schema#",
82101
"title": "Boolean",

contracts/middleware/verification/sp1-verifier/src/contract.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
3737
proof,
3838
payload,
3939
} => to_json_binary(&verify(deps, &vk, proof, inputs, payload)?),
40+
QueryMsg::DomainVk {} => {
41+
// Return the stored domain verification key
42+
let domain_vk = DOMAIN_VK.load(deps.storage)?;
43+
to_json_binary(&domain_vk)
44+
}
4045
}
4146
}
4247

packages/verification-utils/src/verifier.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ pub enum QueryMsg {
1616
proof: Binary,
1717
payload: Binary,
1818
},
19+
20+
#[returns(Binary)]
21+
DomainVk {},
1922
}

0 commit comments

Comments
 (0)