1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
// Copyright 2020 Solana Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License;
// You may obtain the license via the LICENSE file in the repository root;
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Large uint types
// required for clippy
#![allow(clippy::assign_op_pattern)]
#![allow(clippy::ptr_offset_with_cast)]
#![allow(clippy::manual_range_contains)]
use uint::construct_uint;
construct_uint! {
pub struct U256(4);
}
construct_uint! {
pub struct U192(3);
}
#[cfg(test)]
mod test {
use std::str::FromStr;
use super::*;
#[test]
fn test_uint() {
let u256_a = U256::from_str("2").unwrap();
assert_eq!(u256_a.to_string(), "2".to_string());
let u192_a = U192::from_str("2").unwrap();
assert_eq!(u192_a.to_string(), "2".to_string());
}
}