Fix packet header offset
And update transaction offsets to use the same approach as packet.rs. Maybe this should be serialized_size(), but thanks to this GenericArray update, those values are the same.
This commit is contained in:
parent
60d8f5489f
commit
90ae662e4d
|
@ -340,7 +340,7 @@ pub fn to_blobs<T: Serialize>(
|
||||||
}
|
}
|
||||||
|
|
||||||
const BLOB_INDEX_END: usize = size_of::<u64>();
|
const BLOB_INDEX_END: usize = size_of::<u64>();
|
||||||
const BLOB_ID_END: usize = BLOB_INDEX_END + size_of::<usize>() + size_of::<Pubkey>();
|
const BLOB_ID_END: usize = BLOB_INDEX_END + size_of::<Pubkey>();
|
||||||
const BLOB_FLAGS_END: usize = BLOB_ID_END + size_of::<u32>();
|
const BLOB_FLAGS_END: usize = BLOB_ID_END + size_of::<u32>();
|
||||||
const BLOB_SIZE_END: usize = BLOB_FLAGS_END + size_of::<u64>();
|
const BLOB_SIZE_END: usize = BLOB_FLAGS_END + size_of::<u64>();
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,11 @@ use chrono::prelude::*;
|
||||||
use hash::Hash;
|
use hash::Hash;
|
||||||
use payment_plan::{Payment, PaymentPlan, Witness};
|
use payment_plan::{Payment, PaymentPlan, Witness};
|
||||||
use signature::{Keypair, KeypairUtil, Pubkey, Signature};
|
use signature::{Keypair, KeypairUtil, Pubkey, Signature};
|
||||||
|
use std::mem::size_of;
|
||||||
|
|
||||||
pub const SIGNED_DATA_OFFSET: usize = 96;
|
pub const SIGNED_DATA_OFFSET: usize = PUB_KEY_OFFSET + size_of::<Pubkey>();
|
||||||
pub const SIG_OFFSET: usize = 0;
|
pub const SIG_OFFSET: usize = 0;
|
||||||
pub const PUB_KEY_OFFSET: usize = 64;
|
pub const PUB_KEY_OFFSET: usize = size_of::<Signature>();
|
||||||
|
|
||||||
/// The type of payment plan. Each item must implement the PaymentPlan trait.
|
/// The type of payment plan. Each item must implement the PaymentPlan trait.
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
||||||
|
|
Loading…
Reference in New Issue