Skip to content

Commit

Permalink
review comments fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
VladasZ committed Nov 17, 2023
1 parent 9b6afc7 commit 550c9dd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: make lint

integration-tests:
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion contract/src/burn/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl Contract {
}

#[cfg(not(test))]
pub(crate) mod not_test {
pub(crate) mod prod {
use model::{TokensAmount, UnixTimestamp};
use near_sdk::{
env, ext_contract, is_promise_success, json_types::U128, near_bindgen, serde_json::json, Gas, Promise,
Expand Down
2 changes: 1 addition & 1 deletion contract/src/claim/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl Contract {
}

#[cfg(not(test))]
mod not_test {
mod prod {
use model::{TokensAmount, UnixTimestamp};
use near_sdk::{
env, ext_contract, is_promise_success, json_types::U128, near_bindgen, serde_json::json, AccountId, Gas,
Expand Down
2 changes: 1 addition & 1 deletion contract/src/record/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl RecordApi for Contract {

require!(
existing.is_none(),
"Record for this timestamp: {now_seconds} already existed. It was owerwritten."
format!("Record for this timestamp: {now_seconds} already existed. It was owerwritten.")
);
}
}
11 changes: 11 additions & 0 deletions contract/src/record/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,14 @@ fn record_by_oracle() {
let bob_actual_balance = contract.get_claimable_balance_for_account(accounts.bob.clone());
assert_eq!(bob_balance, bob_actual_balance.0);
}


#[test]
#[should_panic(expected = "Record for this timestamp: 0 already existed. It was owerwritten.")]
fn test_record() {
let (mut context, mut contract, accounts) = Context::init_with_oracle();

context.switch_account(&accounts.oracle);
contract.record_batch_for_hold(vec![(accounts.alice.clone(), 10.into())]);
contract.record_batch_for_hold(vec![(accounts.alice, 10.into())]);
}
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.73"
channel = "1.74"

0 comments on commit 550c9dd

Please sign in to comment.