Struct casper_node::types::Deploy[][src]

pub struct Deploy { /* fields omitted */ }

A deploy; an item containing a smart contract along with the requester’s signature(s).

Implementations

impl Deploy[src]

pub fn new(
    timestamp: Timestamp,
    ttl: TimeDiff,
    gas_price: u64,
    dependencies: Vec<DeployHash>,
    chain_name: String,
    payment: ExecutableDeployItem,
    session: ExecutableDeployItem,
    secret_key: &SecretKey
) -> Deploy
[src]

Constructs a new signed Deploy.

pub fn sign(&mut self, secret_key: &SecretKey)[src]

Adds a signature of this deploy’s hash to its approvals.

pub fn id(&self) -> &DeployHash[src]

Returns the DeployHash identifying this Deploy.

pub fn header(&self) -> &DeployHeader[src]

Returns a reference to the DeployHeader of this Deploy.

pub fn take_header(self) -> DeployHeader[src]

Returns the DeployHeader of this Deploy.

pub fn payment(&self) -> &ExecutableDeployItem[src]

Returns the ExecutableDeployItem for payment code.

pub fn session(&self) -> &ExecutableDeployItem[src]

Returns the ExecutableDeployItem for session code.

pub fn approvals(&self) -> &[Approval][src]

Returns the Approvals for this deploy.

pub fn deploy_type(&self) -> Result<DeployType, Error>[src]

Returns the DeployType.

pub fn is_valid_size(
    &self,
    max_deploy_size: u32
) -> Result<(), ExcessiveSizeError>
[src]

Returns true if the serialized size of the deploy is not greater than max_deploy_size.

pub fn is_valid(&mut self) -> Result<(), DeployValidationFailure>[src]

Returns true if and only if:

  • the deploy hash is correct (should be the hash of the header), and
  • the body hash is correct (should be the hash of the body), and
  • all approvals are valid signatures of the deploy hash

pub fn is_acceptable(
    &mut self,
    chain_name: &str,
    config: &DeployConfig
) -> Result<(), DeployValidationFailure>
[src]

Returns true if and only if:

  • the chain_name is correct,
  • the configured parameters are complied with,
  • the deploy is valid

Note: if everything else checks out, calls the computationally expensive is_valid method.

Trait Implementations

impl Clone for Deploy[src]

impl DataSize for Deploy[src]

impl Debug for Deploy[src]

impl<'de> Deserialize<'de> for Deploy[src]

impl Display for Deploy[src]

impl DocExample for Deploy[src]

impl Eq for Deploy[src]

impl FromBytes for Deploy[src]

impl Hash for Deploy[src]

impl Item for Deploy[src]

type Id = DeployHash

The type of ID of the item.

impl JsonSchema for Deploy[src]

impl Ord for Deploy[src]

impl PartialEq<Deploy> for Deploy[src]

impl PartialOrd<Deploy> for Deploy[src]

impl Serialize for Deploy[src]

impl StructuralEq for Deploy[src]

impl StructuralPartialEq for Deploy[src]

impl ToBytes for Deploy[src]

Auto Trait Implementations

impl RefUnwindSafe for Deploy

impl Send for Deploy

impl Sync for Deploy

impl Unpin for Deploy

impl UnwindSafe for Deploy

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> DynClone for T where
    T: Clone
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]