Skip to content

Commit

Permalink
feat(token): add a panic handler for no_std envs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfertel committed Mar 18, 2024
1 parent 22954f9 commit 8b43549
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ jobs:
# Intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4
# --feature-powerset runs for every combination of features
- name: cargo hack
run: cargo hack --feature-powerset check
run: cargo hack --feature-powerset check --release
2 changes: 1 addition & 1 deletion .github/workflows/nostd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
- name: rustup target add ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}
- name: cargo check
run: cargo check --target ${{ matrix.target }} --no-default-features --workspace --all-features
run: cargo check --release --target ${{ matrix.target }} --no-default-features --workspace --all-features
6 changes: 6 additions & 0 deletions contracts/token/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ extern crate alloc;

#[global_allocator]
static ALLOC: mini_alloc::MiniAlloc = mini_alloc::MiniAlloc::INIT;

#[cfg(not(test))]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}

0 comments on commit 8b43549

Please sign in to comment.