2020-09-22 14:53:52 +02:00
|
|
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
|
|
|
// This file is part of OpenEthereum.
|
2016-06-28 14:28:42 +02:00
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
// OpenEthereum is free software: you can redistribute it and/or modify
|
2016-06-28 14:28:42 +02:00
|
|
|
// 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.
|
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
// OpenEthereum is distributed in the hope that it will be useful,
|
2016-06-28 14:28:42 +02:00
|
|
|
// 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
|
2020-09-22 14:53:52 +02:00
|
|
|
// along with OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
|
2016-06-28 14:28:42 +02:00
|
|
|
|
|
|
|
//! 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;
|
2021-02-02 16:26:55 +01:00
|
|
|
mod typed_transaction;
|
2016-06-28 12:08:30 +02:00
|
|
|
|
2018-04-16 15:52:12 +02:00
|
|
|
pub use self::{
|
2021-02-02 16:26:55 +01:00
|
|
|
block::BlockView, body::BodyView, header::HeaderView, typed_transaction::TypedTransactionView,
|
2018-04-16 15:52:12 +02:00
|
|
|
view_rlp::ViewRlp,
|
2016-06-28 12:08:30 +02:00
|
|
|
};
|
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
|
|
|
}
|