mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-26 06:31:19 +00:00
chore(lint): add staged lint baseline
This commit is contained in:
committed by
r4bbit
parent
035f593f5e
commit
49d7f91ee5
@@ -3,6 +3,9 @@ name = "token-methods"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[build-dependencies]
|
||||
risc0-build = "=3.0.5"
|
||||
|
||||
|
||||
@@ -5,6 +5,32 @@ edition = "2021"
|
||||
|
||||
[workspace]
|
||||
|
||||
[lints.rust]
|
||||
rust_2018_idioms = { level = "deny", priority = -1 }
|
||||
unsafe_code = "forbid"
|
||||
|
||||
[lints.clippy]
|
||||
all = { level = "deny", priority = -1 }
|
||||
allow_attributes = "warn"
|
||||
allow_attributes_without_reason = "deny"
|
||||
arithmetic_side_effects = "deny"
|
||||
as_conversions = "deny"
|
||||
cast_possible_truncation = "deny"
|
||||
cast_possible_wrap = "deny"
|
||||
cast_precision_loss = "warn"
|
||||
cast_sign_loss = "deny"
|
||||
dbg_macro = "deny"
|
||||
indexing_slicing = "deny"
|
||||
integer_division = "warn"
|
||||
large_enum_variant = "deny"
|
||||
match_wildcard_for_single_variants = "warn"
|
||||
module_name_repetitions = "allow"
|
||||
similar_names = "allow"
|
||||
todo = "deny"
|
||||
unimplemented = "deny"
|
||||
unwrap_used = "deny"
|
||||
wildcard_enum_match_arm = "deny"
|
||||
|
||||
[[bin]]
|
||||
name = "token"
|
||||
path = "src/bin/token.rs"
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
#![no_main]
|
||||
#![cfg_attr(not(test), no_main)]
|
||||
|
||||
use spel_framework::prelude::*;
|
||||
use spel_framework::context::ProgramContext;
|
||||
use nssa_core::account::AccountWithMetadata;
|
||||
|
||||
#[cfg(not(test))]
|
||||
risc0_zkvm::guest::entry!(main);
|
||||
|
||||
#[lez_program(instruction = "token_core::Instruction")]
|
||||
mod token {
|
||||
#[allow(unused_imports)]
|
||||
#[expect(
|
||||
unused_imports,
|
||||
reason = "SPEL instruction macro requires importing parent-scope handler types"
|
||||
)]
|
||||
use super::*;
|
||||
|
||||
/// Transfer tokens from sender to recipient.
|
||||
@@ -48,6 +52,10 @@ mod token {
|
||||
|
||||
/// Create a new fungible or non-fungible token definition with metadata.
|
||||
/// Definition, holding, and metadata targets must be uninitialized and authorized.
|
||||
#[expect(
|
||||
clippy::boxed_local,
|
||||
reason = "boxed metadata keeps the instruction argument size bounded on the stack"
|
||||
)]
|
||||
#[instruction]
|
||||
pub fn new_definition_with_metadata(
|
||||
definition_target_account: AccountWithMetadata,
|
||||
|
||||
Reference in New Issue
Block a user