Skip to content

Commit 0840ab1

Browse files
committed
Merge branch 'main' into aw/pinned-cache-metrics
2 parents 95ca4b1 + 4060b2c commit 0840ab1

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ and this project adheres to
99
### Added
1010

1111
- cosmwasm-vm: Add `secp256r1_verify` and `secp256r1_recover_pubkey` imports for
12-
ECDSA signature verification over secp256r1. ([#1983], [#2057])
12+
ECDSA signature verification over secp256r1. ([#1983], [#2057], [#2058])
1313
- cosmwasm-vm: Add metrics for the pinned memory cache ([#2059])
1414

1515
[#1983]: https://github.com/CosmWasm/cosmwasm/pull/1983
1616
[#2057]: https://github.com/CosmWasm/cosmwasm/pull/2057
17+
[#2058]: https://github.com/CosmWasm/cosmwasm/pull/2058
1718

1819
### Changed
1920

packages/std/src/traits.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,33 @@ pub trait Api {
165165
recovery_param: u8,
166166
) -> Result<Vec<u8>, RecoverPubkeyError>;
167167

168+
#[allow(unused_variables)]
168169
fn secp256r1_verify(
169170
&self,
170171
message_hash: &[u8],
171172
signature: &[u8],
172173
public_key: &[u8],
173-
) -> Result<bool, VerificationError>;
174+
) -> Result<bool, VerificationError> {
175+
// Support for secp256r1 is added in 2.1, i.e. we can't add a compile time requirement for new function.
176+
// Any implementation of the Api trait which does not implement this function but tries to call it will
177+
// panic at runtime. We don't assume such cases exist.
178+
// See also https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item
179+
unimplemented!()
180+
}
174181

182+
#[allow(unused_variables)]
175183
fn secp256r1_recover_pubkey(
176184
&self,
177185
message_hash: &[u8],
178186
signature: &[u8],
179187
recovery_param: u8,
180-
) -> Result<Vec<u8>, RecoverPubkeyError>;
188+
) -> Result<Vec<u8>, RecoverPubkeyError> {
189+
// Support for secp256r1 was added in 2.1, i.e. we can't add a compile time requirement for new function.
190+
// Any implementation of the Api trait which does not implement this function but tries to call it will
191+
// panic at runtime. We don't assume such cases exist.
192+
// See also https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item
193+
unimplemented!()
194+
}
181195

182196
fn ed25519_verify(
183197
&self,

0 commit comments

Comments
 (0)