From 17ed330d4111df1fae44beee1b194ce18b2c2a87 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 18 Mar 2024 11:25:12 -0700 Subject: [PATCH] Rename RuneID fields (#3310) --- src/index/entry.rs | 23 +-- src/index/testing.rs | 4 +- src/runes.rs | 311 +++++++++++++++++++-------------------- src/runes/rune_id.rs | 48 ++---- src/runes/runestone.rs | 56 +++---- src/subcommand/runes.rs | 8 +- src/subcommand/server.rs | 18 +-- src/templates/rune.rs | 27 ++-- src/templates/runes.rs | 5 +- templates/rune.html | 8 +- tests/json_api.rs | 20 +-- tests/lib.rs | 12 +- tests/runes.rs | 33 ++--- 13 files changed, 247 insertions(+), 326 deletions(-) diff --git a/src/index/entry.rs b/src/index/entry.rs index 50726896f0..de0669d31b 100644 --- a/src/index/entry.rs +++ b/src/index/entry.rs @@ -225,12 +225,12 @@ pub(super) type RuneIdValue = (u32, u16); impl Entry for RuneId { type Value = RuneIdValue; - fn load((height, index): Self::Value) -> Self { - Self { height, index } + fn load((block, tx): Self::Value) -> Self { + Self { block, tx } } fn store(self) -> Self::Value { - (self.height, self.index) + (self.block, self.tx) } } @@ -554,22 +554,9 @@ mod tests { #[test] fn rune_id_entry() { - assert_eq!( - RuneId { - height: 1, - index: 2, - } - .store(), - (1, 2), - ); + assert_eq!(RuneId { block: 1, tx: 2 }.store(), (1, 2),); - assert_eq!( - RuneId { - height: 1, - index: 2, - }, - RuneId::load((1, 2)), - ); + assert_eq!(RuneId { block: 1, tx: 2 }, RuneId::load((1, 2)),); } #[test] diff --git a/src/index/testing.rs b/src/index/testing.rs index 00ada3fc23..d68014b2d8 100644 --- a/src/index/testing.rs +++ b/src/index/testing.rs @@ -199,9 +199,9 @@ impl Context { ( txid, RuneId { - height: u32::try_from(block_count + usize::try_from(RUNE_COMMIT_INTERVAL).unwrap() + 1) + block: u32::try_from(block_count + usize::try_from(RUNE_COMMIT_INTERVAL).unwrap() + 1) .unwrap(), - index: 1, + tx: 1, }, ) } diff --git a/src/runes.rs b/src/runes.rs index 389639bc6c..6b28dc4499 100644 --- a/src/runes.rs +++ b/src/runes.rs @@ -117,7 +117,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -152,7 +152,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -218,7 +218,7 @@ mod tests { etching: txid, rune: Rune(minimum), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -277,7 +277,7 @@ mod tests { etching: txid, rune: Rune(RESERVED - 1), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -313,10 +313,7 @@ mod tests { ..Default::default() }); - let id0 = RuneId { - height: 2, - index: 1, - }; + let id0 = RuneId { block: 2, tx: 1 }; context.mine_blocks(1); @@ -364,10 +361,7 @@ mod tests { context.mine_blocks(1); - let id1 = RuneId { - height: 4, - index: 1, - }; + let id1 = RuneId { block: 4, tx: 1 }; context.assert_runes( [ @@ -443,7 +437,7 @@ mod tests { etching: txid, divisibility: 1, supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -485,7 +479,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -528,7 +522,7 @@ mod tests { rune: Rune(RUNE), supply: u128::MAX, symbol: None, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -565,7 +559,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: 100, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -608,7 +602,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: 200, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -650,7 +644,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: 100, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -685,7 +679,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -699,7 +693,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: Some( Runestone { edicts: vec![Edict { @@ -723,7 +717,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -765,7 +759,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -815,7 +809,7 @@ mod tests { spacers: 1, supply: 0, symbol: Some('$'), - timestamp: id.height, + timestamp: id.block, }, )], [], @@ -848,10 +842,7 @@ mod tests { context.mine_blocks(1); - let id = RuneId { - height: 2, - index: 1, - }; + let id = RuneId { block: 2, tx: 1 }; context.assert_runes( [( @@ -894,7 +885,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -908,7 +899,7 @@ mod tests { ); context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: Some( Runestone { burn: true, @@ -929,7 +920,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -964,7 +955,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -978,7 +969,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: Some(Runestone::default().encipher()), ..Default::default() }); @@ -992,7 +983,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1033,7 +1024,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1047,7 +1038,7 @@ mod tests { ); context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: Some(Runestone::default().encipher()), outputs: 0, ..Default::default() @@ -1062,7 +1053,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, burned: u128::MAX, ..Default::default() }, @@ -1098,7 +1089,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1112,7 +1103,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], outputs: 2, op_return: Some( Runestone { @@ -1133,7 +1124,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1174,7 +1165,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1188,7 +1179,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], outputs: 2, op_return: Some( Runestone { @@ -1209,7 +1200,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1250,7 +1241,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1264,7 +1255,7 @@ mod tests { ); context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], outputs: 2, op_return: Some( Runestone { @@ -1286,7 +1277,7 @@ mod tests { rune: Rune(RUNE), supply: u128::MAX, burned: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1322,7 +1313,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1336,7 +1327,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: None, ..Default::default() }); @@ -1350,7 +1341,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1391,7 +1382,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1423,7 +1414,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1458,7 +1449,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, )], @@ -1495,7 +1486,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, ), @@ -1505,7 +1496,7 @@ mod tests { etching: txid1, rune: Rune(RUNE + 1), supply: u128::MAX, - timestamp: id1.height, + timestamp: id1.block, number: 1, ..Default::default() }, @@ -1531,8 +1522,8 @@ mod tests { let txid2 = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[ - (id0.height.try_into().unwrap(), 1, 0, Witness::new()), - (id1.height.try_into().unwrap(), 1, 0, Witness::new()), + (id0.block.try_into().unwrap(), 1, 0, Witness::new()), + (id1.block.try_into().unwrap(), 1, 0, Witness::new()), ], ..Default::default() }); @@ -1547,7 +1538,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, ), @@ -1557,7 +1548,7 @@ mod tests { etching: txid1, rune: Rune(RUNE + 1), supply: u128::MAX, - timestamp: id1.height, + timestamp: id1.block, number: 1, ..Default::default() }, @@ -1600,7 +1591,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, )], @@ -1637,7 +1628,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, ), @@ -1647,7 +1638,7 @@ mod tests { etching: txid1, rune: Rune(RUNE + 1), supply: u128::MAX, - timestamp: id1.height, + timestamp: id1.block, number: 1, ..Default::default() }, @@ -1673,8 +1664,8 @@ mod tests { let txid2 = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[ - (id0.height.try_into().unwrap(), 1, 0, Witness::new()), - (id1.height.try_into().unwrap(), 1, 0, Witness::new()), + (id0.block.try_into().unwrap(), 1, 0, Witness::new()), + (id1.block.try_into().unwrap(), 1, 0, Witness::new()), ], ..Default::default() }); @@ -1689,7 +1680,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, ), @@ -1699,7 +1690,7 @@ mod tests { etching: txid1, rune: Rune(RUNE + 1), supply: u128::MAX, - timestamp: id1.height, + timestamp: id1.block, number: 1, ..Default::default() }, @@ -1715,7 +1706,7 @@ mod tests { ); let txid3 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[((id1.height + 1).try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[((id1.block + 1).try_into().unwrap(), 1, 0, Witness::new())], outputs: 2, op_return: Some( Runestone { @@ -1748,7 +1739,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, ), @@ -1758,7 +1749,7 @@ mod tests { etching: txid1, rune: Rune(RUNE + 1), supply: u128::MAX, - timestamp: id1.height, + timestamp: id1.block, number: 1, ..Default::default() }, @@ -1810,7 +1801,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, )], @@ -1847,7 +1838,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, ), @@ -1857,7 +1848,7 @@ mod tests { etching: txid1, rune: Rune(RUNE + 1), supply: u128::MAX, - timestamp: id1.height, + timestamp: id1.block, number: 1, ..Default::default() }, @@ -1883,8 +1874,8 @@ mod tests { let txid2 = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[ - (id0.height.try_into().unwrap(), 1, 0, Witness::new()), - (id1.height.try_into().unwrap(), 1, 0, Witness::new()), + (id0.block.try_into().unwrap(), 1, 0, Witness::new()), + (id1.block.try_into().unwrap(), 1, 0, Witness::new()), ], op_return: Some( Runestone { @@ -1917,7 +1908,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, ), @@ -1927,7 +1918,7 @@ mod tests { etching: txid1, rune: Rune(RUNE + 1), supply: u128::MAX, - timestamp: id1.height, + timestamp: id1.block, number: 1, ..Default::default() }, @@ -1971,7 +1962,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -1985,7 +1976,7 @@ mod tests { ); let txid = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: Some( script::Builder::new() .push_opcode(opcodes::all::OP_RETURN) @@ -2004,7 +1995,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2056,7 +2047,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, ), @@ -2066,7 +2057,7 @@ mod tests { etching: txid1, rune: Rune(RUNE + 1), supply: u128::MAX, - timestamp: id1.height, + timestamp: id1.block, number: 1, ..Default::default() }, @@ -2120,7 +2111,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2134,7 +2125,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: Some( Runestone { edicts: vec![ @@ -2165,7 +2156,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2206,7 +2197,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, )], @@ -2243,7 +2234,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, ), @@ -2253,7 +2244,7 @@ mod tests { etching: txid1, rune: Rune(RUNE + 1), supply: u128::MAX, - timestamp: id1.height, + timestamp: id1.block, number: 1, ..Default::default() }, @@ -2278,7 +2269,7 @@ mod tests { ); let txid2 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id0.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id0.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: Some( Runestone { edicts: vec![ @@ -2310,7 +2301,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id0.height, + timestamp: id0.block, ..Default::default() }, ), @@ -2320,7 +2311,7 @@ mod tests { etching: txid1, rune: Rune(RUNE + 1), supply: u128::MAX, - timestamp: id1.height, + timestamp: id1.block, number: 1, ..Default::default() }, @@ -2372,7 +2363,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX / 2, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2386,7 +2377,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: Some( Runestone { edicts: vec![Edict { @@ -2410,7 +2401,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX / 2, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2452,7 +2443,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2487,7 +2478,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2529,7 +2520,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2564,7 +2555,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2611,7 +2602,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2670,7 +2661,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2710,7 +2701,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: 4000, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2757,7 +2748,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2803,7 +2794,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2846,7 +2837,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2860,7 +2851,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], outputs: 2, op_return: Some( Runestone { @@ -2885,7 +2876,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2935,7 +2926,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -2949,7 +2940,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], outputs: 2, op_return: Some( Runestone { @@ -2981,7 +2972,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3031,7 +3022,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3045,7 +3036,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], outputs: 2, op_return: Some( Runestone { @@ -3077,7 +3068,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3127,7 +3118,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3141,7 +3132,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], outputs: 2, op_return: Some( Runestone { @@ -3166,7 +3157,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3216,7 +3207,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3230,7 +3221,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], outputs: 4, op_return: Some( Runestone { @@ -3262,7 +3253,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3312,7 +3303,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3326,7 +3317,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], outputs: 4, op_return: Some( Runestone { @@ -3358,7 +3349,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3424,7 +3415,7 @@ mod tests { rune: Rune(RUNE), supply: u128::MAX, symbol: Some('$'), - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3459,7 +3450,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3494,7 +3485,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3508,7 +3499,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 1, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], outputs: 2, op_return: Some( Runestone { @@ -3533,7 +3524,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3580,7 +3571,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - timestamp: id.height, + timestamp: id.block, mints: 0, mint: Some(MintEntry { limit: Some(1000), @@ -3619,7 +3610,7 @@ mod tests { mints: 1, rune: Rune(RUNE), supply: 1000, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3658,7 +3649,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - timestamp: id.height, + timestamp: id.block, mints: 0, mint: Some(MintEntry { limit: Some(1000), @@ -3702,7 +3693,7 @@ mod tests { mints: 1, rune: Rune(RUNE), supply: 1000, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3747,7 +3738,7 @@ mod tests { mints: 2, rune: Rune(RUNE), supply: 2000, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3803,7 +3794,7 @@ mod tests { mints: 3, rune: Rune(RUNE), supply: 3000, - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3854,10 +3845,10 @@ mod tests { rune: Rune(RUNE), mint: Some(MintEntry { limit: Some(1000), - end: Some(id.height + 2), + end: Some(id.block + 2), ..Default::default() }), - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -3891,11 +3882,11 @@ mod tests { rune: Rune(RUNE), mint: Some(MintEntry { limit: Some(1000), - end: Some(id.height + 2), + end: Some(id.block + 2), ..Default::default() }), supply: 1000, - timestamp: id.height, + timestamp: id.block, mints: 1, ..Default::default() }, @@ -3935,10 +3926,10 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: 1000, - timestamp: id.height, + timestamp: id.block, mint: Some(MintEntry { limit: Some(1000), - end: Some(id.height + 2), + end: Some(id.block + 2), ..Default::default() }), mints: 1, @@ -3988,10 +3979,10 @@ mod tests { rune: Rune(RUNE), mint: Some(MintEntry { limit: Some(1000), - end: Some(id.height), + end: Some(id.block), ..Default::default() }), - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -4024,10 +4015,10 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - timestamp: id.height, + timestamp: id.block, mint: Some(MintEntry { limit: Some(1000), - end: Some(id.height), + end: Some(id.block), ..Default::default() }), ..Default::default() @@ -4078,7 +4069,7 @@ mod tests { ); let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(id.height.try_into().unwrap(), 0, 0, Witness::new())], + inputs: &[(id.block.try_into().unwrap(), 0, 0, Witness::new())], op_return: Some( Runestone { claim: Some(id), @@ -4186,7 +4177,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - timestamp: id.height, + timestamp: id.block, mint: Some(MintEntry { deadline: Some(11), end: Some(12), @@ -4218,7 +4209,7 @@ mod tests { RuneEntry { rune: Rune(RUNE), supply: 1000, - timestamp: id.height, + timestamp: id.block, mints: 1, etching: txid0, mint: Some(MintEntry { @@ -4259,7 +4250,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: 1000, - timestamp: id.height, + timestamp: id.block, mint: Some(MintEntry { limit: Some(1000), deadline: Some(11), @@ -4305,9 +4296,9 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - timestamp: id.height, + timestamp: id.block, mint: Some(MintEntry { - deadline: Some(id.height + 2), + deadline: Some(id.block + 2), limit: Some(1000), ..Default::default() }), @@ -4342,11 +4333,11 @@ mod tests { RuneEntry { rune: Rune(RUNE), supply: 1000, - timestamp: id.height, + timestamp: id.block, mints: 1, etching: txid0, mint: Some(MintEntry { - deadline: Some(id.height + 2), + deadline: Some(id.block + 2), limit: Some(1000), ..Default::default() }), @@ -4388,10 +4379,10 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: 1000, - timestamp: id.height, + timestamp: id.block, mint: Some(MintEntry { limit: Some(1000), - deadline: Some(id.height + 2), + deadline: Some(id.block + 2), ..Default::default() }), mints: 1, @@ -4437,7 +4428,7 @@ mod tests { limit: Some(1000), ..Default::default() }), - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -4471,7 +4462,7 @@ mod tests { etching: txid0, rune: Rune(RUNE), supply: 1000, - timestamp: id.height, + timestamp: id.block, mint: Some(MintEntry { limit: Some(1000), ..Default::default() @@ -4533,7 +4524,7 @@ mod tests { limit: Some(1000), ..Default::default() }), - timestamp: id.height, + timestamp: id.block, supply: 1000, ..Default::default() }, @@ -4567,7 +4558,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - timestamp: id.height, + timestamp: id.block, mint: Some(MintEntry { limit: Some(MAX_LIMIT), deadline: None, @@ -4604,7 +4595,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - timestamp: id.height, + timestamp: id.block, mints: 1, supply: MAX_LIMIT, mint: Some(MintEntry { @@ -4652,10 +4643,10 @@ mod tests { rune: Rune(RUNE), mint: Some(MintEntry { limit: None, - end: Some(id.height + 1), + end: Some(id.block + 1), ..Default::default() }), - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -4697,7 +4688,7 @@ mod tests { limit: Some(1000), ..Default::default() }), - timestamp: id.height, + timestamp: id.block, supply: 1000, ..Default::default() }, @@ -4740,7 +4731,7 @@ mod tests { limit: Some(1000), ..Default::default() }), - timestamp: id.height, + timestamp: id.block, supply: 2000, mints: 1, ..Default::default() @@ -4794,7 +4785,7 @@ mod tests { limit: Some(1000), ..Default::default() }), - timestamp: id.height, + timestamp: id.block, ..Default::default() }, )], @@ -4842,7 +4833,7 @@ mod tests { limit: Some(1000), ..Default::default() }), - timestamp: id.height, + timestamp: id.block, supply: 1000, mints: 1, ..Default::default() diff --git a/src/runes/rune_id.rs b/src/runes/rune_id.rs index 2ba260207f..5473328f87 100644 --- a/src/runes/rune_id.rs +++ b/src/runes/rune_id.rs @@ -2,8 +2,8 @@ use {super::*, std::num::TryFromIntError}; #[derive(Debug, PartialEq, Copy, Clone, Hash, Eq, Ord, PartialOrd)] pub struct RuneId { - pub height: u32, - pub index: u16, + pub block: u32, + pub tx: u16, } impl TryFrom for RuneId { @@ -11,21 +11,21 @@ impl TryFrom for RuneId { fn try_from(n: u128) -> Result { Ok(Self { - height: u32::try_from(n >> 16)?, - index: u16::try_from(n & 0xFFFF).unwrap(), + block: u32::try_from(n >> 16)?, + tx: u16::try_from(n & 0xFFFF).unwrap(), }) } } impl From for u128 { fn from(id: RuneId) -> Self { - u128::from(id.height) << 16 | u128::from(id.index) + u128::from(id.block) << 16 | u128::from(id.tx) } } impl Display for RuneId { fn fmt(&self, f: &mut Formatter) -> fmt::Result { - write!(f, "{}:{}", self.height, self.index,) + write!(f, "{}:{}", self.block, self.tx,) } } @@ -38,8 +38,8 @@ impl FromStr for RuneId { .ok_or_else(|| anyhow!("invalid rune ID: {s}"))?; Ok(Self { - height: height.parse()?, - index: index.parse()?, + block: height.parse()?, + tx: index.parse()?, }) } } @@ -70,24 +70,13 @@ mod tests { fn rune_id_to_128() { assert_eq!( 0b11_0000_0000_0000_0001u128, - RuneId { - height: 3, - index: 1, - } - .into() + RuneId { block: 3, tx: 1 }.into() ); } #[test] fn display() { - assert_eq!( - RuneId { - height: 1, - index: 2 - } - .to_string(), - "1:2" - ); + assert_eq!(RuneId { block: 1, tx: 2 }.to_string(), "1:2"); } #[test] @@ -97,13 +86,7 @@ mod tests { assert!(":2".parse::().is_err()); assert!("a:2".parse::().is_err()); assert!("1:a".parse::().is_err()); - assert_eq!( - "1:2".parse::().unwrap(), - RuneId { - height: 1, - index: 2 - } - ); + assert_eq!("1:2".parse::().unwrap(), RuneId { block: 1, tx: 2 }); } #[test] @@ -111,8 +94,8 @@ mod tests { assert_eq!( RuneId::try_from(0x060504030201).unwrap(), RuneId { - height: 0x06050403, - index: 0x0201 + block: 0x06050403, + tx: 0x0201 } ); @@ -121,10 +104,7 @@ mod tests { #[test] fn serde() { - let rune_id = RuneId { - height: 1, - index: 2, - }; + let rune_id = RuneId { block: 1, tx: 2 }; let json = "\"1:2\""; assert_eq!(serde_json::to_string(&rune_id).unwrap(), json); assert_eq!(serde_json::from_str::(json).unwrap(), rune_id); diff --git a/src/runes/runestone.rs b/src/runes/runestone.rs index 937aedb153..feefdf6d56 100644 --- a/src/runes/runestone.rs +++ b/src/runes/runestone.rs @@ -1285,11 +1285,7 @@ mod tests { case( vec![Edict { amount: 0, - id: RuneId { - height: 0, - index: 0, - } - .into(), + id: RuneId { block: 0, tx: 0 }.into(), output: 0, }], Some(Etching { @@ -1303,11 +1299,7 @@ mod tests { case( vec![Edict { amount: u128::MAX, - id: RuneId { - height: 0, - index: 0, - } - .into(), + id: RuneId { block: 0, tx: 0 }.into(), output: 0, }], Some(Etching { @@ -1322,8 +1314,8 @@ mod tests { vec![Edict { amount: 0, id: RuneId { - height: 1_000_000, - index: u16::MAX, + block: 1_000_000, + tx: u16::MAX, } .into(), output: 0, @@ -1336,8 +1328,8 @@ mod tests { vec![Edict { amount: u128::MAX, id: RuneId { - height: 1_000_000, - index: u16::MAX, + block: 1_000_000, + tx: u16::MAX, } .into(), output: 0, @@ -1351,8 +1343,8 @@ mod tests { Edict { amount: u128::MAX, id: RuneId { - height: 1_000_000, - index: u16::MAX, + block: 1_000_000, + tx: u16::MAX, } .into(), output: 0, @@ -1360,8 +1352,8 @@ mod tests { Edict { amount: u128::MAX, id: RuneId { - height: 1_000_000, - index: u16::MAX, + block: 1_000_000, + tx: u16::MAX, } .into(), output: 0, @@ -1376,8 +1368,8 @@ mod tests { Edict { amount: u128::MAX, id: RuneId { - height: 1_000_000, - index: u16::MAX, + block: 1_000_000, + tx: u16::MAX, } .into(), output: 0, @@ -1385,8 +1377,8 @@ mod tests { Edict { amount: u128::MAX, id: RuneId { - height: 1_000_000, - index: u16::MAX, + block: 1_000_000, + tx: u16::MAX, } .into(), output: 0, @@ -1394,8 +1386,8 @@ mod tests { Edict { amount: u128::MAX, id: RuneId { - height: 1_000_000, - index: u16::MAX, + block: 1_000_000, + tx: u16::MAX, } .into(), output: 0, @@ -1410,8 +1402,8 @@ mod tests { Edict { amount: u64::MAX.into(), id: RuneId { - height: 1_000_000, - index: u16::MAX, + block: 1_000_000, + tx: u16::MAX, } .into(), output: 0, @@ -1427,8 +1419,8 @@ mod tests { Edict { amount: u64::MAX.into(), id: RuneId { - height: 1_000_000, - index: u16::MAX, + block: 1_000_000, + tx: u16::MAX, } .into(), output: 0, @@ -1444,8 +1436,8 @@ mod tests { Edict { amount: u64::MAX.into(), id: RuneId { - height: 0, - index: u16::MAX, + block: 0, + tx: u16::MAX, } .into(), output: 0, @@ -1461,8 +1453,8 @@ mod tests { Edict { amount: 1_000_000_000_000_000_000, id: RuneId { - height: 1_000_000, - index: u16::MAX, + block: 1_000_000, + tx: u16::MAX, } .into(), output: 0, diff --git a/src/subcommand/runes.rs b/src/subcommand/runes.rs index dd99e79eab..9770078192 100644 --- a/src/subcommand/runes.rs +++ b/src/subcommand/runes.rs @@ -7,12 +7,11 @@ pub struct Output { #[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct RuneInfo { + pub block: u32, pub burned: u128, pub divisibility: u8, pub etching: Txid, - pub height: u32, pub id: RuneId, - pub index: u16, pub mint: Option, pub mints: u64, pub number: u64, @@ -21,6 +20,7 @@ pub struct RuneInfo { pub supply: u128, pub symbol: Option, pub timestamp: DateTime, + pub tx: u16, } pub(crate) fn run(settings: Settings) -> SubcommandResult { @@ -57,12 +57,11 @@ pub(crate) fn run(settings: Settings) -> SubcommandResult { ( rune, RuneInfo { + block: id.block, burned, divisibility, etching, - height: id.height, id, - index: id.index, mint, mints, number, @@ -71,6 +70,7 @@ pub(crate) fn run(settings: Settings) -> SubcommandResult { supply, symbol, timestamp: crate::timestamp(timestamp), + tx: id.tx, }, ) }, diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index 3eb2e527aa..daf07900d9 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -2133,8 +2133,8 @@ mod tests { ( txid, RuneId { - height: self.index.block_count().unwrap() - 1, - index: 1, + block: self.index.block_count().unwrap() - 1, + tx: 1, }, ) } @@ -2684,7 +2684,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, symbol: Some('%'), ..Default::default() } @@ -2755,7 +2755,7 @@ mod tests { rune, supply: u128::MAX, symbol: Some('%'), - timestamp: id.height, + timestamp: id.block, ..Default::default() } )] @@ -2780,9 +2780,9 @@ mod tests {
id
9:1
-
etching block height
+
etching block
9
-
etching transaction index
+
etching transaction
1
mint
no
@@ -2865,7 +2865,7 @@ mod tests { rune, supply: u128::MAX, symbol: Some('%'), - timestamp: id.height, + timestamp: id.block, spacers: 1, ..Default::default() } @@ -2954,7 +2954,7 @@ mod tests { etching: txid, rune: Rune(RUNE), supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() } )] @@ -3015,7 +3015,7 @@ mod tests { etching: txid, rune, supply: u128::MAX, - timestamp: id.height, + timestamp: id.block, ..Default::default() } )] diff --git a/src/templates/rune.rs b/src/templates/rune.rs index 94282e0acf..cab1a80c3f 100644 --- a/src/templates/rune.rs +++ b/src/templates/rune.rs @@ -38,10 +38,7 @@ mod tests { symbol: Some('%'), timestamp: 0, }, - id: RuneId { - height: 10, - index: 9, - }, + id: RuneId { block: 10, tx: 9 }, parent: Some(InscriptionId { txid: Txid::all_zeros(), index: 0, @@ -56,9 +53,9 @@ mod tests {
id
10:9
-
etching block height
+
etching block
10
-
etching transaction index
+
etching transaction
9
mint
@@ -107,10 +104,7 @@ mod tests { symbol: Some('%'), timestamp: 0, }, - id: RuneId { - height: 10, - index: 9, - }, + id: RuneId { block: 10, tx: 9 }, parent: None, }, "

B•CGDENLQRQWDSLRUGSNLBTMFIJAV

@@ -121,9 +115,9 @@ mod tests {
id
10:9
-
etching block height
+
etching block
10
-
etching transaction index
+
etching transaction
9
mint
no
@@ -163,10 +157,7 @@ mod tests { symbol: Some('%'), timestamp: 0, }, - id: RuneId { - height: 10, - index: 9, - }, + id: RuneId { block: 10, tx: 9 }, parent: None, }, "

B•CGDENLQRQWDSLRUGSNLBTMFIJAV

@@ -177,9 +168,9 @@ mod tests {
id
10:9
-
etching block height
+
etching block
10
-
etching transaction index
+
etching transaction
9
mint
diff --git a/src/templates/runes.rs b/src/templates/runes.rs index c8e9951e1a..f6e6591d88 100644 --- a/src/templates/runes.rs +++ b/src/templates/runes.rs @@ -20,10 +20,7 @@ mod tests { assert_eq!( RunesHtml { entries: vec![( - RuneId { - height: 0, - index: 0, - }, + RuneId { block: 0, tx: 0 }, RuneEntry { rune: Rune(26), spacers: 1, diff --git a/templates/rune.html b/templates/rune.html index 89ffb10ce6..4e3022fba7 100644 --- a/templates/rune.html +++ b/templates/rune.html @@ -9,10 +9,10 @@

{{ self.entry.spaced_rune() }}

id
{{ self.id }}
-
etching block height
-
{{ self.id.height }}
-
etching transaction index
-
{{ self.id.index }}
+
etching block
+
{{ self.id.block }}
+
etching transaction
+
{{ self.id.tx }}
mint
%% if let Some(mint) = self.entry.mint {
diff --git a/tests/json_api.rs b/tests/json_api.rs index c45e25943f..c1f6c40656 100644 --- a/tests/json_api.rs +++ b/tests/json_api.rs @@ -555,10 +555,7 @@ fn get_runes() { symbol: Some('¢'), timestamp: 11, }, - id: RuneId { - height: 11, - index: 1 - }, + id: RuneId { block: 11, tx: 1 }, parent: Some(InscriptionId { txid: a.inscribe.reveal, index: 0, @@ -577,10 +574,7 @@ fn get_runes() { api::Runes { entries: vec![ ( - RuneId { - height: 11, - index: 1 - }, + RuneId { block: 11, tx: 1 }, RuneEntry { burned: 0, mint: None, @@ -596,10 +590,7 @@ fn get_runes() { } ), ( - RuneId { - height: 19, - index: 1 - }, + RuneId { block: 19, tx: 1 }, RuneEntry { burned: 0, mint: None, @@ -615,10 +606,7 @@ fn get_runes() { } ), ( - RuneId { - height: 27, - index: 1 - }, + RuneId { block: 27, tx: 1 }, RuneEntry { burned: 0, mint: None, diff --git a/tests/lib.rs b/tests/lib.rs index 42749c4828..51ea4289ff 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -230,8 +230,8 @@ fn batch( let height = bitcoin_rpc_server.height(); let id = RuneId { - height: u32::try_from(height).unwrap(), - index: 1, + block: u32::try_from(height).unwrap(), + tx: 1, }; let reveal = inscribe.reveal; @@ -289,13 +289,17 @@ fn batch( mint_definition.push("
no
".into()); } + let RuneId { block, tx } = id; + ord_rpc_server.assert_response_regex( format!("/rune/{rune}"), format!( r".*
id
{id}
.* -
etching transaction index
-
1
+
etching block
+
{block}
+
etching transaction
+
{tx}
mint
{}
supply
diff --git a/tests/runes.rs b/tests/runes.rs index 0dd114d75f..21861463c3 100644 --- a/tests/runes.rs +++ b/tests/runes.rs @@ -53,16 +53,12 @@ fn one_rune() { runes: vec![( Rune(RUNE), RuneInfo { + block: 8, burned: 0, - mint: None, divisibility: 0, etching: etch.inscribe.reveal, - height: 8, - id: RuneId { - height: 8, - index: 1 - }, - index: 1, + id: RuneId { block: 8, tx: 1 }, + mint: None, mints: 0, number: 0, rune: Rune(RUNE), @@ -70,6 +66,7 @@ fn one_rune() { supply: 1000, symbol: Some('¢'), timestamp: ord::timestamp(8), + tx: 1, } )] .into_iter() @@ -101,16 +98,12 @@ fn two_runes() { ( Rune(RUNE), RuneInfo { + block: 8, burned: 0, - mint: None, divisibility: 0, etching: a.inscribe.reveal, - height: 8, - id: RuneId { - height: 8, - index: 1 - }, - index: 1, + id: RuneId { block: 8, tx: 1 }, + mint: None, mints: 0, number: 0, rune: Rune(RUNE), @@ -118,21 +111,18 @@ fn two_runes() { supply: 1000, symbol: Some('¢'), timestamp: ord::timestamp(8), + tx: 1, } ), ( Rune(RUNE + 1), RuneInfo { + block: 16, burned: 0, - mint: None, divisibility: 0, etching: b.inscribe.reveal, - height: 16, - id: RuneId { - height: 16, - index: 1 - }, - index: 1, + id: RuneId { block: 16, tx: 1 }, + mint: None, mints: 0, number: 1, rune: Rune(RUNE + 1), @@ -140,6 +130,7 @@ fn two_runes() { supply: 1000, symbol: Some('¢'), timestamp: ord::timestamp(16), + tx: 1, } ) ]