2018-06-04 10:19:50 +02:00
|
|
|
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
|
2016-06-28 14:28:42 +02:00
|
|
|
// This file is part of Parity.
|
|
|
|
|
|
|
|
// Parity is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
|
|
// Parity is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
//! Block oriented views onto rlp.
|
|
|
|
|
2018-04-16 15:52:12 +02:00
|
|
|
#[macro_use]
|
|
|
|
mod view_rlp;
|
2016-06-28 14:28:42 +02:00
|
|
|
mod block;
|
2018-02-23 20:01:33 +01:00
|
|
|
mod body;
|
2016-06-28 14:28:42 +02:00
|
|
|
mod header;
|
2016-06-28 12:08:30 +02:00
|
|
|
mod transaction;
|
|
|
|
|
2018-04-16 15:52:12 +02:00
|
|
|
pub use self::view_rlp::ViewRlp;
|
2016-06-28 14:28:42 +02:00
|
|
|
pub use self::block::BlockView;
|
2016-07-28 23:46:24 +02:00
|
|
|
pub use self::body::BodyView;
|
2018-02-23 20:01:33 +01:00
|
|
|
pub use self::header::HeaderView;
|
2016-06-28 12:08:30 +02:00
|
|
|
pub use self::transaction::TransactionView;
|
2018-04-16 15:52:12 +02:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
2018-10-31 11:50:38 +01:00
|
|
|
use super::HeaderView;
|
2018-04-16 15:52:12 +02:00
|
|
|
|
2018-10-31 11:50:38 +01:00
|
|
|
#[test]
|
|
|
|
#[should_panic]
|
|
|
|
fn should_include_file_line_number_in_panic_for_invalid_rlp() {
|
|
|
|
let _ = view!(HeaderView, &[]).parent_hash();
|
|
|
|
}
|
2018-06-04 10:19:50 +02:00
|
|
|
}
|