Near-One / near-plugins

Implementation of common patterns used for NEAR smart contracts.
Creative Commons Zero v1.0 Universal
27 stars 12 forks source link

feat(Pausable)!: make `pa_[un]pause` return `bool` #91

Closed mooori closed 1 year ago

mooori commented 1 year ago

Makes pa_pause and pa_unpause return a bool that indicates whether the feature is newly (un)paused. This corresponds to the return values of std::collections::HashSet methods insert and remove.

Closes this external issue.

Other changes: events

This PR also changes event emitting behavior. Sneaking it into this PR since it only reorders code in the two functions that are modified here.

Previously events Pause and Unpause were emitted even if:

To avoid this, code that emits events has been moved past actions that may fail.

Breaking changes