Class Deploy
Inheritance
System.Object
Deploy
Assembly: Casper.Network.SDK.dll
Syntax
public class Deploy : object
Constructors
Declaration
public Deploy(DeployHeader header, ExecutableDeployItem payment, ExecutableDeployItem session)
Parameters
Declaration
public Deploy(string hash, DeployHeader header, ExecutableDeployItem payment, ExecutableDeployItem session, List<DeployApproval> approvals)
Parameters
Properties
Approvals
List of signers and signatures for this Deploy.
Declaration
public List<DeployApproval> Approvals { get; }
Property Value
Hash
A hash over the header of the deploy.
Declaration
public string Hash { get; }
Property Value
Type |
Description |
System.String |
|
Contains metadata about the deploy.
Declaration
public DeployHeader Header { get; }
Property Value
Payment
Contains the payment amount for the deploy.
Declaration
public ExecutableDeployItem Payment { get; }
Property Value
Session
Contains the session information for the deploy.
Declaration
public ExecutableDeployItem Session { get; }
Property Value
Methods
AddApproval(DeployApproval)
Adds an approval to the deploy. No check is done to the approval signature.
Declaration
public void AddApproval(DeployApproval approval)
Parameters
GetDeploySizeInBytes()
returns the number of bytes resulting from the binary serialization of the Deploy.
Declaration
public int GetDeploySizeInBytes()
Returns
Type |
Description |
System.Int32 |
|
Load(String)
Loads and deserializes a Deploy from a file.
Declaration
public static Deploy Load(string filename)
Parameters
Type |
Name |
Description |
System.String |
filename |
|
Returns
Parse(String)
Parses a Deploy from a file.
Declaration
public static Deploy Parse(string json)
Parameters
Type |
Name |
Description |
System.String |
json |
|
Returns
Save(String)
Saves a deploy object to a file.
Declaration
public void Save(string filename)
Parameters
Type |
Name |
Description |
System.String |
filename |
|
SerializeToJson()
Returns a json string with the deploy.
Declaration
public string SerializeToJson()
Returns
Type |
Description |
System.String |
|
Sign(KeyPair)
Signs the deploy with a private key and adds a new Approval to it.
Declaration
public void Sign(KeyPair keyPair)
Parameters
Type |
Name |
Description |
KeyPair |
keyPair |
|
ValidateHashes(out String)
Validates the body and header hashes in the deploy.
Declaration
public bool ValidateHashes(out string message)
Parameters
Type |
Name |
Description |
System.String |
message |
output string with a validation error message if validation fails. empty otherwise.
|
Returns
Type |
Description |
System.Boolean |
false if the validation of hashes is not successful
|
VerifySignatures(out String)
Verifies the signatures in the list of approvals.
Declaration
public bool VerifySignatures(out string message)
Parameters
Type |
Name |
Description |
System.String |
message |
an output string with the signer which signature could not be verified. empty if verification succeeds.
|
Returns
Type |
Description |
System.Boolean |
false if the verification of a signature fails.
|