diff --git a/src/neo/Consensus/ConsensusMessage.cs b/src/neo/Consensus/ConsensusMessage.cs index 856ccdc72b..53a28e7830 100644 --- a/src/neo/Consensus/ConsensusMessage.cs +++ b/src/neo/Consensus/ConsensusMessage.cs @@ -15,7 +15,7 @@ public abstract class ConsensusMessage : ISerializable protected ConsensusMessage(ConsensusMessageType type) { if (!Enum.IsDefined(typeof(ConsensusMessageType), type)) - throw new ArgumentOutOfRangeException(nameof(type)); + throw new FormatException(nameof(type)); this.Type = type; } diff --git a/src/neo/Network/P2P/Payloads/TransactionAttribute.cs b/src/neo/Network/P2P/Payloads/TransactionAttribute.cs index d4c31b2e49..fde51ee0f3 100644 --- a/src/neo/Network/P2P/Payloads/TransactionAttribute.cs +++ b/src/neo/Network/P2P/Payloads/TransactionAttribute.cs @@ -39,7 +39,7 @@ public static TransactionAttribute FromJson(JObject json) TransactionAttribute transactionAttribute = new TransactionAttribute(); transactionAttribute.Usage = (TransactionAttributeUsage)byte.Parse(json["usage"].AsString()); if (!Enum.IsDefined(typeof(TransactionAttributeUsage), transactionAttribute.Usage)) - throw new ArgumentException(); + throw new FormatException(); transactionAttribute.Data = Convert.FromBase64String(json["data"].AsString()); return transactionAttribute; }