Skip to content

Commit 824905e

Browse files
committed
Add Noop
1 parent cc059dc commit 824905e

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

contracts/cyberpunk/schema/cyberpunk.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,20 @@
179179
}
180180
},
181181
"additionalProperties": false
182+
},
183+
{
184+
"description": "Does nothing. This can be used for baseline contract execution performance measurements.",
185+
"type": "object",
186+
"required": [
187+
"noop"
188+
],
189+
"properties": {
190+
"noop": {
191+
"type": "object",
192+
"additionalProperties": false
193+
}
194+
},
195+
"additionalProperties": false
182196
}
183197
]
184198
},

contracts/cyberpunk/schema/raw/execute.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,20 @@
169169
}
170170
},
171171
"additionalProperties": false
172+
},
173+
{
174+
"description": "Does nothing. This can be used for baseline contract execution performance measurements.",
175+
"type": "object",
176+
"required": [
177+
"noop"
178+
],
179+
"properties": {
180+
"noop": {
181+
"type": "object",
182+
"additionalProperties": false
183+
}
184+
},
185+
"additionalProperties": false
172186
}
173187
]
174188
}

contracts/cyberpunk/src/contract.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ pub fn execute(
3939
Unreachable {} => execute_unreachable(),
4040
MirrorEnv {} => execute_mirror_env(env),
4141
Debug {} => execute_debug(deps.api),
42+
Noop {} => execute_noop(),
4243
}
4344
}
4445

@@ -178,6 +179,10 @@ fn execute_debug(api: &dyn Api) -> Result<Response, ContractError> {
178179
Ok(Response::default())
179180
}
180181

182+
fn execute_noop() -> Result<Response, ContractError> {
183+
Ok(Response::new())
184+
}
185+
181186
#[entry_point]
182187
pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<QueryResponse> {
183188
use QueryMsg::*;

contracts/cyberpunk/src/msg.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ pub enum ExecuteMsg {
3030
MirrorEnv {},
3131
/// Does a bit of work and calls debug
3232
Debug {},
33+
/// Does nothing. This can be used for baseline contract execution performance measurements.
34+
Noop {},
3335
}
3436

3537
#[cw_serde]

0 commit comments

Comments
 (0)