Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual improvements #1

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
4 changes: 2 additions & 2 deletions dotnet-algorand-sdk/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public class Account
/// <returns>the rebuilded account</returns>
public static Account AccountFromPrivateKey(byte[] privateKey)
{
if(privateKey.Length != SK_SIZE)
if(privateKey.Length != SK_SIZE)
throw new ArgumentException("Incorrect private key length");

var privateKeyRebuild = new Ed25519PrivateKeyParameters(privateKey, 0);
var publicKeyRebuild = privateKeyRebuild.GeneratePublicKey();
var act = new Account
Expand Down
28 changes: 14 additions & 14 deletions dotnet-algorand-sdk/Algod/Model/AssetParams.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Algod REST API.
*
* API Endpoint for AlgoD Operations.
Expand Down Expand Up @@ -73,7 +73,7 @@ public partial class AssetParams : IEquatable<AssetParams>, IValidatableObject
this.Unitname = unitname;
this.Url = url;
}

/// <summary>
/// AssetName specifies the name of this asset, as supplied by the creator.
/// </summary>
Expand Down Expand Up @@ -173,7 +173,7 @@ public override string ToString()
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
Expand Down Expand Up @@ -203,57 +203,57 @@ public bool Equals(AssetParams input)
if (input == null)
return false;

return
return
(
this.Assetname == input.Assetname ||
(this.Assetname != null &&
this.Assetname.Equals(input.Assetname))
) &&
) &&
(
this.Clawbackaddr == input.Clawbackaddr ||
(this.Clawbackaddr != null &&
this.Clawbackaddr.Equals(input.Clawbackaddr))
) &&
) &&
(
this.Creator == input.Creator ||
(this.Creator != null &&
this.Creator.Equals(input.Creator))
) &&
) &&
(
this.Defaultfrozen == input.Defaultfrozen ||
(this.Defaultfrozen != null &&
this.Defaultfrozen.Equals(input.Defaultfrozen))
) &&
) &&
(
this.Freezeaddr == input.Freezeaddr ||
(this.Freezeaddr != null &&
this.Freezeaddr.Equals(input.Freezeaddr))
) &&
) &&
(
this.Managerkey == input.Managerkey ||
(this.Managerkey != null &&
this.Managerkey.Equals(input.Managerkey))
) &&
) &&
(
this.Metadatahash == input.Metadatahash ||
(this.Metadatahash != null &&
this.Metadatahash.Equals(input.Metadatahash))
) &&
) &&
(
this.Reserveaddr == input.Reserveaddr ||
(this.Reserveaddr != null &&
this.Reserveaddr.Equals(input.Reserveaddr))
) &&
) &&
(
this.Total == input.Total ||
(this.Total != null &&
this.Total.Equals(input.Total))
) &&
) &&
(
this.Unitname == input.Unitname ||
(this.Unitname != null &&
this.Unitname.Equals(input.Unitname))
) &&
) &&
(
this.Url == input.Url ||
(this.Url != null &&
Expand Down
18 changes: 9 additions & 9 deletions dotnet-algorand-sdk/Algod/Model/TransactionParams.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Algod REST API.
*
* API Endpoint for AlgoD Operations.
Expand Down Expand Up @@ -87,7 +87,7 @@ public partial class TransactionParams : IEquatable<TransactionParams>, IValida
}
this.MinFee = minFee;
}

/// <summary>
/// ConsensusVersion indicates the consensus protocol version as of LastRound.
/// </summary>
Expand Down Expand Up @@ -147,7 +147,7 @@ public override string ToString()
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
Expand Down Expand Up @@ -177,32 +177,32 @@ public bool Equals(TransactionParams input)
if (input == null)
return false;

return
return
(
this.ConsensusVersion == input.ConsensusVersion ||
(this.ConsensusVersion != null &&
this.ConsensusVersion.Equals(input.ConsensusVersion))
) &&
) &&
(
this.Fee == input.Fee ||
(this.Fee != null &&
this.Fee.Equals(input.Fee))
) &&
) &&
(
this.GenesisID == input.GenesisID ||
(this.GenesisID != null &&
this.GenesisID.Equals(input.GenesisID))
) &&
) &&
(
this.Genesishashb64 == input.Genesishashb64 ||
(this.Genesishashb64 != null &&
this.Genesishashb64.Equals(input.Genesishashb64))
) &&
) &&
(
this.LastRound == input.LastRound ||
(this.LastRound != null &&
this.LastRound.Equals(input.LastRound))
) &&
) &&
(
this.MinFee == input.MinFee ||
(this.MinFee != null &&
Expand Down
5 changes: 3 additions & 2 deletions dotnet-algorand-sdk/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ public static Transaction CreateAssetRevokeTransaction(// AssetTransaction
genesisHash)
{
assetReceiver = assetReceiver, //arcv
assetSender = assetRevokedFrom, //asnd
assetSender = assetRevokedFrom, //asnd
assetAmount = assetAmount, // aamt
sender = transactionSender // snd
}; // gh
Expand Down Expand Up @@ -919,10 +919,11 @@ public class Type
public static readonly Type AssetTransfer = new Type(4);
public static readonly Type AssetFreeze = new Type(5);
public static readonly Type ApplicationCall = new Type(6);
public static readonly Type StateProof = new Type(7);

private static Dictionary<string, int> namesMap = new Dictionary<string, int> {
{"", 0 }, {"pay", 1}, {"keyreg", 2},
{ "acfg", 3}, {"axfer", 4}, { "afrz", 5}, { "appl", 6}
{ "acfg", 3}, {"axfer", 4}, { "afrz", 5}, { "appl", 6}, { "sptf", 7}
};
/// <summary>
/// Return the enumeration for the given string value. Required for JSON serialization.
Expand Down
Loading