Struct exonum_btc_anchoring::blockchain::MsgAnchoringSignature
[−]
pub struct MsgAnchoringSignature { /* fields omitted */ }
Exonum message with the signature for the new anchoring transaction.
Methods
impl MsgAnchoringSignature
pub fn new(
from: &PublicKey,
validator: ValidatorId,
tx: AnchoringTx,
input: u32,
signature: &[u8],
secret_key: &SecretKey
) -> MsgAnchoringSignature
from: &PublicKey,
validator: ValidatorId,
tx: AnchoringTx,
input: u32,
signature: &[u8],
secret_key: &SecretKey
) -> MsgAnchoringSignature
Creates message and signs it.
pub fn new_with_signature(
from: &PublicKey,
validator: ValidatorId,
tx: AnchoringTx,
input: u32,
signature: &[u8],
signature: &Signature
) -> MsgAnchoringSignature
from: &PublicKey,
validator: ValidatorId,
tx: AnchoringTx,
input: u32,
signature: &[u8],
signature: &Signature
) -> MsgAnchoringSignature
Creates message and appends existing signature.
pub fn to_hex(&self) -> String
Returns the hex representation of the binary data. Lower case letters are used (e.g. f9b4ca).
pub fn from(&self) -> &PublicKey
Public key of validator.
pub fn validator(&self) -> ValidatorId
Public key index in anchoring public keys list.
pub fn tx(&self) -> AnchoringTx
Transaction content.
pub fn input(&self) -> u32
Signed input.
pub fn signature(&self) -> &[u8]
Signature for the corresponding input
.
impl MsgAnchoringSignature
[src]
pub fn verify_content(&self) -> bool
[src]
pub fn validate(&self, view: &Fork) -> Result<(), ValidateError>
[src]
Trait Implementations
impl<'a> From<&'a MsgAnchoringSignature> for KnownSignatureId
[src]
fn from(msg: &'a MsgAnchoringSignature) -> KnownSignatureId
[src]
Performs the conversion.
impl Clone for MsgAnchoringSignature
fn clone(&self) -> MsgAnchoringSignature
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for MsgAnchoringSignature
fn eq(&self, __arg_0: &MsgAnchoringSignature) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &MsgAnchoringSignature) -> bool
This method tests for !=
.
impl ServiceMessage for MsgAnchoringSignature
const SERVICE_ID: u16
SERVICE_ID: u16 = ANCHORING_SERVICE_ID
ID of the service this message belongs to.
const MESSAGE_ID: u16
MESSAGE_ID: u16 = 0
ID of the message itself. Should be unique within a service. Read more
impl Message for MsgAnchoringSignature
fn from_raw(raw: RawMessage) -> Result<MsgAnchoringSignature, Error>
Converts the raw message into the specific one.
fn raw(&self) -> &RawMessage
Returns raw message.
fn verify_signature(&self, pub_key: &PublicKey) -> bool
[src]
Verifies the message using given public key.
impl<'a> SegmentField<'a> for MsgAnchoringSignature
fn item_size() -> Offset
size of item fixed part that this Field
collect.
fn count(&self) -> Offset
count of items in collection
fn extend_buffer(&self, buffer: &mut Vec<u8>)
extend buffer with this collection
unsafe fn from_buffer(buffer: &'a [u8], from: Offset, count: Offset) -> Self
create collection from buffer
fn check_data(
buffer: &'a [u8],
from: CheckedOffset,
count: CheckedOffset,
latest_segment: CheckedOffset
) -> Result
buffer: &'a [u8],
from: CheckedOffset,
count: CheckedOffset,
latest_segment: CheckedOffset
) -> Result
check collection data
impl AsRef<RawMessage> for MsgAnchoringSignature
fn as_ref(&self) -> &RawMessage
Performs the conversion.
impl FromHex for MsgAnchoringSignature
type Error = Error
fn from_hex<T: AsRef<[u8]>>(hex: T) -> Result<Self, Self::Error>
Creates an instance of type Self
from the given hex string, or fails with a custom error type. Read more
impl StorageValue for MsgAnchoringSignature
fn into_bytes(self) -> Vec<u8>
Serialize a value into a vector of bytes.
fn from_bytes(value: Cow<[u8]>) -> Self
Deserialize a value from bytes.
impl Debug for MsgAnchoringSignature
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl ExonumJson for MsgAnchoringSignature
fn deserialize_field<B>(
value: &Value,
buffer: &mut B,
from: Offset,
to: Offset
) -> Result<(), Box<Error>> where
B: WriteBufferWrapper,
value: &Value,
buffer: &mut B,
from: Offset,
to: Offset
) -> Result<(), Box<Error>> where
B: WriteBufferWrapper,
write deserialized field in buffer on place.
fn serialize_field(&self) -> Result<Value, Box<Error + Send + Sync>>
serialize field as json::Value
impl ExonumJsonDeserialize for MsgAnchoringSignature
fn deserialize(value: &Value) -> Result<Self, Box<Error>>
deserialize json
value.
impl<'de> Deserialize<'de> for MsgAnchoringSignature
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Serialize for MsgAnchoringSignature
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Transaction for MsgAnchoringSignature
[src]
fn verify(&self) -> bool
[src]
Verifies the internal consistency of the transaction. verify
should usually include checking the message signature (via [verify_signature
]) and, possibly, other internal constraints. verify
has no access to the blockchain state; checks involving the blockchains state must be preformed in execute
. Read more
fn execute(&self, fork: &mut Fork) -> ExecutionResult
[src]
Receives a fork of the current blockchain state and can modify it depending on the contents of the transaction. Read more