SHOWING: First 60
#76,217,422text#74,437,562text#74,437,561texttransfer100.pizza#71,285,751brc-20#70,720,679 if end == Some(self.height) {
0
} else {
limit
}
} else {
u128::max_value()
} - balance,
end,
symbol,
limit,
timestamp: self.timestamp,
}
.store(),
)?;
let inscription_id = InscriptionId { txid, index: 0 };
if let Some(sequence_number) = self
.inscription_id_to_sequence_number
.get(&inscription_id.store())?
{
self
.sequence_number_to_rune
.insert(sequence_number.value(), rune.0)?;
}
}
}
let mut burned: HashMap<u128, u128> = HashMap::new();
if burn {
for (id, balance) in unallocated {
*burned.entry(id).or_default() += balance;
}
} else {
// Assign all un-allocated runes to the first non OP_RETURN output
if let Some((vout, _)) = tx
.output
.iter()
.enumerate()
.find(|(_, tx_out)| !tx_out.script_pubkey.is_op_return())
#45,004,071text id: 0,
amount: u128::max_value(),
output: 0,
}],
etching: Some(Etching {
divisibility: 1,
rune: Rune(RUNE),
..Default::default()
}),
..Default::default()
}
.encipher(),
),
..Default::default()
});
context.mine_blocks(1);
let id = RuneId {
height: 2,
index: 1,
};
context.assert_runes(
[(
id,
RuneEntry {
rune: Rune(RUNE),
etching: txid,
divisibility: 1,
supply: u128::max_value(),
timestamp: 2,
..Default::default()
},
)],
[(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])],
);
}
#[test]
fn allocations_over_max_supply_are_ignored() {
let context = Context::builder()
.arg("--index-runes-pre-alpha-i-agree-to-get-rekt")
.build();
context.mine_blocks(1);
let txid = context.rpc_server.broadcast_tx(TransactionTemplate {
#45,003,287textclavichords 10109
entfremdung 10111
colocalized 10115
expedientes 10116
brassington 10120
neopaganism 10120
dharmasutra 10128
nonspeaking 10129
megamachine 10131
journaliste 10133
anthesteria 10134
botanischen 10135
biomagnetic 10142
drelincourt 10143
mallikarjun 10152
cheiranthus 10154
giovannucci 10155
aftenposten 10156
bushwalking 10161
bushmanland 10164
methysticum 10168
eugenically 10169
factorially 10173
geniculatum 10175
leontopolis 10182
expendables 10184
heattreated 10185
auseinander 10188
castroviejo 10189
maltotriose 10192
centrations 10203
banteringly 10213
geoelectric 10216
misoriented 10217
capitalista 10222
colocynthis 10222
endovaginal 10223
monogamists 10224
debranching 10227
lutherische 10235
corpuscules 10238
calorically 10242
galliformes 10247
desaguadero 10251
imagewriter 10260
bluebottles 10261
forbindelse 10261
corniferous 10262
epiphysitis 10266
decahydrate 10271
magnificats 10276
hydrocotyle 10284
coacervates 10285
fazendeiros 10289
aufeinander 10290
atlanticism 10298
belarusians 10298
#45,002,337text assert_eq!(Sat(2067187500000000).cycle(), 1);
assert_eq!(Sat(2067187500000000 + 1).cycle(), 1);
}
#[test]
fn third() {
assert_eq!(Sat(0).third(), 0);
assert_eq!(Sat(50 * COIN_VALUE - 1).third(), 4999999999);
assert_eq!(Sat(50 * COIN_VALUE).third(), 0);
assert_eq!(Sat(50 * COIN_VALUE + 1).third(), 1);
}
#[test]
fn percentile() {
assert_eq!(Sat(0).percentile(), "0%");
assert_eq!(Sat(Sat::LAST.n() / 2).percentile(), "49.99999999999998%");
assert_eq!(Sat::LAST.percentile(), "100%");
}
#[test]
fn from_percentile() {
"-1%".parse::<Sat>().unwrap_err();
"101%".parse::<Sat>().unwrap_err();
}
#[test]
fn percentile_round_trip() {
#[track_caller]
fn case(n: u64) {
let expected = Sat(n);
let actual = expected.percentile().parse::<Sat>().unwrap();
assert_eq!(expected, actual);
}
for n in 0..1024 {
case(n);
case(Sat::LAST.n() / 2 + n);
case(Sat::LAST.n() - n);
case(Sat::LAST.n() / (n + 1));
}
#44,995,899text