Skip to content

Commit

Permalink
fix: remove backstop auth check on emitter distribute function
Browse files Browse the repository at this point in the history
  • Loading branch information
mootz12 committed Oct 31, 2023
1 parent 1e63b4d commit 6848105
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
1 change: 0 additions & 1 deletion emitter/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ impl Emitter for EmitterContract {
fn distribute(e: Env) -> i128 {
storage::bump_instance(&e);
let backstop_address = storage::get_backstop(&e);
backstop_address.require_auth();

let distribution_amount = emitter::execute_distribute(&e, &backstop_address);

Expand Down
17 changes: 2 additions & 15 deletions test-suites/tests/test_emitter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![cfg(test)]

use soroban_sdk::{
testutils::{Address as _, AuthorizedFunction, AuthorizedInvocation, Events},
testutils::{Address as _, Events},
vec, Address, IntoVal, Symbol,
};
use test_suites::{
Expand Down Expand Up @@ -41,20 +41,7 @@ fn test_emitter() {
fixture.jump(6 * 24 * 60 * 60);
let result = fixture.emitter.distribute();
backstop_blnd_balance += result;
assert_eq!(
fixture.env.auths()[0],
(
fixture.backstop.address.clone(),
AuthorizedInvocation {
function: AuthorizedFunction::Contract((
fixture.emitter.address.clone(),
Symbol::new(&fixture.env, "distribute"),
vec![&fixture.env,]
)),
sub_invocations: std::vec![]
}
)
);
assert_eq!(fixture.env.auths().len(), 0);
assert_eq!(result, (6 * 24 * 60 * 60 + 61 * 60) * SCALAR_7); // 1 token per second are emitted
assert_eq!(
blnd_token.balance(&fixture.emitter.address),
Expand Down

0 comments on commit 6848105

Please sign in to comment.