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

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,
    rng: &mut dyn CryptoRngCore
) -> Deploy
[src]

Constructs a new Deploy.

pub fn sign(&mut self, secret_key: &SecretKey, rng: &mut dyn CryptoRngCore)[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 is_valid(&mut self) -> bool[src]

Returns true iff:

  • 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
  • the approvals are all valid signatures of the deploy hash

Note: this is a relatively expensive operation, requiring re-serialization of the deploy, hashing, and signature checking, so should be called as infrequently as possible.

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 Eq for Deploy[src]

impl From<Deploy> for DeployItem[src]

impl Hash for Deploy[src]

impl Item for Deploy[src]

type Id = DeployHash

The type of ID of the item.

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]

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> FromBits<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> Same<T> for T

type Output = T

Should always be Self

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

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, 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]