Skip to content

Commit eb28f37

Browse files
committed
feat: add load_u128
1 parent fea8070 commit eb28f37

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: src/cell/parser.rs

+12
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ impl CellParser<'_> {
8383
.map_cell_parser_error()
8484
}
8585

86+
pub fn load_u128(&mut self, bit_len: usize) -> Result<u128, TonCellError> {
87+
self.bit_reader
88+
.read::<u128>(bit_len as u32)
89+
.map_cell_parser_error()
90+
}
91+
92+
pub fn load_i128(&mut self, bit_len: usize) -> Result<i128, TonCellError> {
93+
self.bit_reader
94+
.read::<i128>(bit_len as u32)
95+
.map_cell_parser_error()
96+
}
97+
8698
pub fn load_uint(&mut self, bit_len: usize) -> Result<BigUint, TonCellError> {
8799
let num_words = (bit_len + 31) / 32;
88100
let high_word_bits = if bit_len % 32 == 0 { 32 } else { bit_len % 32 };

0 commit comments

Comments
 (0)