Class Deploy
Assembly: Casper.Network.SDK.dll
Syntax
Constructors
|
Edit this page
View Source
Declaration
public Deploy(DeployHeader header, ExecutableDeployItem payment, ExecutableDeployItem session)
Parameters
|
Edit this page
View Source
Declaration
[JsonConstructor]
public Deploy(string hash, DeployHeader header, ExecutableDeployItem payment, ExecutableDeployItem session, List<Approval> approvals)
Parameters
Properties
|
Edit this page
View Source
Approvals
List of signers and signatures for this Deploy.
Declaration
[JsonPropertyName("approvals")]
public List<Approval> Approvals { get; }
Property Value
|
Edit this page
View Source
Hash
A hash over the header of the deploy.
Declaration
[JsonPropertyName("hash")]
public string Hash { get; }
Property Value
|
Edit this page
View Source
Contains metadata about the deploy.
Declaration
[JsonPropertyName("header")]
public DeployHeader Header { get; }
Property Value
|
Edit this page
View Source
Payment
Contains the payment amount for the deploy.
Declaration
[JsonPropertyName("payment")]
[JsonConverter(typeof(ExecutableDeployItemConverter))]
public ExecutableDeployItem Payment { get; }
Property Value
|
Edit this page
View Source
Session
Contains the session information for the deploy.
Declaration
[JsonPropertyName("session")]
[JsonConverter(typeof(ExecutableDeployItemConverter))]
public ExecutableDeployItem Session { get; }
Property Value
Methods
|
Edit this page
View Source
AddApproval(Approval)
Adds an approval to the deploy. No check is done to the approval signature.
Declaration
public void AddApproval(Approval approval)
Parameters
|
Edit this page
View Source
GetDeploySizeInBytes()
returns the number of bytes resulting from the binary serialization of the Deploy.
Declaration
public int GetDeploySizeInBytes()
Returns
|
Edit this page
View Source
Load(string)
Loads and deserializes a Deploy from a file.
Declaration
public static Deploy Load(string filename)
Parameters
| Type |
Name |
Description |
| string |
filename |
|
Returns
|
Edit this page
View Source
Parse(string)
Parses a Deploy from a file.
Declaration
public static Deploy Parse(string json)
Parameters
| Type |
Name |
Description |
| string |
json |
|
Returns
|
Edit this page
View Source
Save(string)
Saves a deploy object to a file.
Declaration
public void Save(string filename)
Parameters
| Type |
Name |
Description |
| string |
filename |
|
|
Edit this page
View Source
SerializeToJson()
Returns a json string with the deploy.
Declaration
public string SerializeToJson()
Returns
|
Edit this page
View Source
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 |
|
|
Edit this page
View Source
ValidateHashes(out string)
Validates the body and header hashes in the deploy.
Declaration
public bool ValidateHashes(out string message)
Parameters
| Type |
Name |
Description |
| string |
message |
output string with a validation error message if validation fails. empty otherwise.
|
Returns
| Type |
Description |
| bool |
false if the validation of hashes is not successful
|
|
Edit this page
View Source
VerifySignatures(out string)
Verifies the signatures in the list of approvals.
Declaration
public bool VerifySignatures(out string message)
Parameters
| Type |
Name |
Description |
| string |
message |
an output string with the signer which signature could not be verified. empty if verification succeeds.
|
Returns
| Type |
Description |
| bool |
false if the verification of a signature fails.
|