use super::*; const TAG_BODY: u128 = 0; const TAG_DIVISIBILITY: u128 = 1; const TAG_RUNE: u128 = 2; const TAG_SYMBOL: u128 = 3; const TAG_LIMIT: u128 = 4; const TAG_TERM: u128 = 6; #[allow(unused)] const TAG_BURN: u128 = 256; #[derive(Default, Serialize, Debug, PartialEq)] pub struct Runestone { pub edicts: Vec, pub etching: Option, pub burn: bool, } struct Message { fields: HashMap, body: Vec, } impl Message { fn from_integers(payload: &[u128]) -> Self { let mut body = Vec::new(); let mut fields = HashMap::new(); for i in (0..payload.len()).step_by(2) { let tag = payload[i]; if tag == TAG_BODY { let mut id = 0u128; for chunk in payload[i + 1..].chunks_exact(3) { id = id.saturating_add(chunk[0]); body.push(Edict { id, amount: chunk[1], output: chunk[2], }); } break; } let Some(&value) = payload.get(i + 1) else { break;