pub fn random_with_timestamp_and_ttl(
        rng: &mut TestRng,
        timestamp: Timestamp,
        ttl: TimeDiff,
    ) -> Self {
        let gas_price = rng.gen_range(1..100);

        let dependencies = vec![
            DeployHash::new(Digest::hash(rng.next_u64().to_le_bytes())),
            DeployHash::new(Digest::hash(rng.next_u64().to_le_bytes())),
            DeployHash::new(Digest::hash(rng.next_u64().to_le_bytes())),
        ];
        let chain_name = String::from("casper-example");

        // We need "amount" in order to be able to get correct info via `deploy_info()`.
        let payment_args = runtime_args! {
            "amount" => U512::from(10),
        };
        let payment = ExecutableDeployItem::StoredContractByName {
            name: String::from("casper-example"),
            entry_point: String::from("example-entry-point"),
            args: payment_args,
        };

        let session = rng.gen();

        let secret_key = SecretKey::random(rng);

        Deploy::new(
            timestamp,
            ttl,
            gas_price,
            dependencies,
            chain_name,
            payment,
            session,
            &secret_key,
            None,
        )
    }
/// Generates a random instance but using the specified `timestamp` and `ttl`.
Generates a random instance but using the specified `timestamp` and `ttl`.
Generates a random instance but using the specified ` timestamp ` and ` ttl ` .
pub fn random_with_timestamp_and_ttl(
        rng: &mut TestRng,
        timestamp: Timestamp,
        ttl: TimeDiff,
    ) -> Self {
        let gas_price = rng.gen_range(1..100);
        let dependencies = vec![
            DeployHash::new(Digest::hash(rng.next_u64().to_le_bytes())),
            DeployHash::new(Digest::hash(rng.next_u64().to_le_bytes())),
            DeployHash::new(Digest::hash(rng.next_u64().to_le_bytes())),
        ];
        let chain_name = String::from("casper-example");
        // We need "amount" in order to be able to get correct info via `deploy_info()`.
        let payment_args = runtime_args! {
            "amount" => U512::from(10),
        };
        let payment = ExecutableDeployItem::StoredContractByName {
            name: String::from("casper-example"),
            entry_point: String::from("example-entry-point"),
            args: payment_args,
        };
        let session = rng.gen();
        let secret_key = SecretKey::random(rng);
        Deploy::new(
            timestamp,
            ttl,
            gas_price,
            dependencies,
            chain_name,
            payment,
            session,
            &secret_key,
            None,
        )
    }
pub fn random_with_timestamp_and_ttl ( rng : & mut TestRng , timestamp : Timestamp , ttl : TimeDiff , ) -> Self { let gas_price = rng . gen_range ( 1 .. 100 ) ; let dependencies = vec ! [ DeployHash new ( Digest hash ( rng next_u64 ( ) to_le_bytes ( ) ) ) DeployHash new ( Digest hash ( rng next_u64 ( ) to_le_bytes ( ) ) ) DeployHash new ( Digest hash ( rng next_u64 ( ) to_le_bytes ( ) ) ) ] ; let chain_name = String :: from ( " " ) ; // We need "amount" in order to be able to get correct info via `deploy_info()`. let payment_args = runtime_args ! { " " U512 from ( 10 ) } ; let payment = ExecutableDeployItem :: StoredContractByName { name : String :: from ( " " ) , entry_point : String :: from ( " " ) , args : payment_args , } ; let session = rng . gen ( ) ; let secret_key = SecretKey :: random ( rng ) ; Deploy :: new ( timestamp , ttl , gas_price , dependencies , chain_name , payment , session , & secret_key , None , ) }
Generates a random instance but using the specified `timestamp` and `ttl`.
Generates a random instance but using the specified ` timestamp ` and ` ttl ` .
rng
&mut TestRng
timestamp
Timestamp
ttl
TimeDiff
rng
&mut TestRng
timestamp
Timestamp
ttl
TimeDiff