Skip to content

Commit

Permalink
Merge pull request #1152 from dusk-network/rename-noop-1151
Browse files Browse the repository at this point in the history
license-contract: renamed noop to request_license
  • Loading branch information
miloszm authored Nov 23, 2023
2 parents 70edffa + 3ffe894 commit b3cf59a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 2 additions & 0 deletions contracts/license/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions contracts/license/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions contracts/license/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
11 changes: 8 additions & 3 deletions contracts/license/tests/license.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
4 changes: 2 additions & 2 deletions rusk-recovery/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ fn generate_empty_state<P: AsRef<Path>>(
);

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()?;

Expand Down

0 comments on commit b3cf59a

Please sign in to comment.