Skip to content

Commit

Permalink
Re-export a type and a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenroose committed Sep 2, 2019
1 parent 0ad4704 commit 50dad2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ use ::bitcoin::consensus::encode as btcenc;

use transaction::{Transaction, TxIn, TxOut};

pub use ::bitcoin::consensus::encode::MAX_VEC_SIZE;

/// Encoding error
#[derive(Debug)]
pub enum Error {
Expand Down Expand Up @@ -168,10 +170,10 @@ macro_rules! impl_vec {
let byte_size = (len as usize)
.checked_mul(mem::size_of::<$type>())
.ok_or(self::Error::ParseFailed("Invalid length"))?;
if byte_size > btcenc::MAX_VEC_SIZE {
if byte_size > MAX_VEC_SIZE {
return Err(self::Error::OversizedVectorAllocation {
requested: byte_size,
max: btcenc::MAX_VEC_SIZE,
max: MAX_VEC_SIZE,
});
}
let mut ret = Vec::with_capacity(len as usize);
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ pub use address::{Address, AddressParams, AddressError};
pub use transaction::{OutPoint, PeginData, PegoutData, TxIn, TxOut, TxInWitness, TxOutWitness, Transaction, AssetIssuance};
pub use block::{BlockHeader, Block};
pub use block::ExtData as BlockExtData;
pub use ::bitcoin::consensus::encode::VarInt;

0 comments on commit 50dad2d

Please sign in to comment.