From 63a977dca122716c01c3f601677e87d277e175ec Mon Sep 17 00:00:00 2001 From: Milosz Muszynski Date: Wed, 22 Nov 2023 16:02:00 +0100 Subject: [PATCH] license-contract: renamed noop to request_license --- contracts/license/CHANGELOG.md | 2 ++ contracts/license/src/lib.rs | 4 ++-- contracts/license/src/state.rs | 4 ++-- contracts/license/tests/license.rs | 11 ++++++++--- rusk-recovery/src/state.rs | 4 ++-- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/contracts/license/CHANGELOG.md b/contracts/license/CHANGELOG.md index ca6cb0cf2e..94fbcc1099 100644 --- a/contracts/license/CHANGELOG.md +++ b/contracts/license/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Renamed method 'noop' to 'request_license' [#1151] - Added method 'get_info' [#1052] ### Changed @@ -24,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `license` contract to Rusk [#960] +[#1151]: https://github.com/dusk-network/rusk/issues/1151 [#1054]: https://github.com/dusk-network/rusk/issues/1054 [#1052]: https://github.com/dusk-network/rusk/issues/1052 [#1051]: https://github.com/dusk-network/rusk/issues/1051 diff --git a/contracts/license/src/lib.rs b/contracts/license/src/lib.rs index 8df931bb2a..9c5faf3429 100644 --- a/contracts/license/src/lib.rs +++ b/contracts/license/src/lib.rs @@ -79,8 +79,8 @@ mod wasm { } #[no_mangle] - unsafe fn noop(arg_len: u32) -> u32 { - rusk_abi::wrap_call(arg_len, |_: ()| STATE.noop()) + unsafe fn request_license(arg_len: u32) -> u32 { + rusk_abi::wrap_call(arg_len, |_: ()| STATE.request_license()) } #[no_mangle] diff --git a/contracts/license/src/state.rs b/contracts/license/src/state.rs index 1521ea5beb..2ed1a32b73 100644 --- a/contracts/license/src/state.rs +++ b/contracts/license/src/state.rs @@ -131,8 +131,8 @@ impl LicenseContractState { self.sessions.get(&session_id).cloned() } - /// Noop needed for inserting payloads into blockchain - pub fn noop(&self) {} + /// Method needed for inserting payloads into blockchain + pub fn request_license(&self) {} fn assert_proof( verifier_data: &[u8], diff --git a/contracts/license/tests/license.rs b/contracts/license/tests/license.rs index 695849082f..bc0cc98591 100644 --- a/contracts/license/tests/license.rs +++ b/contracts/license/tests/license.rs @@ -424,9 +424,14 @@ fn use_license_get_session() { } #[test] -fn test_noop() { +fn test_request_license() { let mut session = initialize(); session - .call::<(), ()>(LICENSE_CONTRACT_ID, "noop", &(), POINT_LIMIT) - .expect("Noop should succeed"); + .call::<(), ()>( + LICENSE_CONTRACT_ID, + "request_license", + &(), + POINT_LIMIT, + ) + .expect("Request license should succeed"); } diff --git a/rusk-recovery/src/state.rs b/rusk-recovery/src/state.rs index a88a433db1..dd5ba4b70e 100644 --- a/rusk-recovery/src/state.rs +++ b/rusk-recovery/src/state.rs @@ -252,8 +252,8 @@ fn generate_empty_state>( ); session - .call::<_, ()>(LICENSE_CONTRACT, "noop", &(), u64::MAX) - .expect("license contract noop should succeed"); + .call::<_, ()>(LICENSE_CONTRACT, "request_license", &(), u64::MAX) + .expect("license contract request license method should succeed"); let commit_id = session.commit()?;