-
Notifications
You must be signed in to change notification settings - Fork 1k
DeprecatedIn for events
#3362
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
DeprecatedIn for events
#3362
Changes from 2 commits
a6fa87e
0ce7b9d
e089c26
c097e00
f07e415
655f724
210d6af
cbfb2c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,35 +17,48 @@ namespace Neo.SmartContract.Native | |
| { | ||
| [DebuggerDisplay("{Descriptor.Name}")] | ||
| [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = true)] | ||
| internal class ContractEventAttribute : Attribute | ||
| internal class ContractEventAttribute : Attribute, IHardforkActivable | ||
| { | ||
| public int Order { get; init; } | ||
| public ContractEventDescriptor Descriptor { get; set; } | ||
| public Hardfork? ActiveIn { get; init; } = null; | ||
| public Hardfork? DeprecatedIn { get; init; } = null; | ||
|
|
||
| public ContractEventAttribute(Hardfork activeIn, int order, string name, | ||
| string arg1Name, ContractParameterType arg1Value) : this(order, name, arg1Name, arg1Value) | ||
| { | ||
| ActiveIn = activeIn; | ||
| } | ||
|
|
||
| public ContractEventAttribute(Hardfork activeIn, int order, string name, | ||
| string arg1Name, ContractParameterType arg1Value, Hardfork deprecatedIn) : this(activeIn, order, name, arg1Name, arg1Value) | ||
| { | ||
| DeprecatedIn = deprecatedIn; | ||
| } | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you really need all these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes because enum doesn't work as arguments :( |
||
| public ContractEventAttribute(int order, string name, string arg1Name, ContractParameterType arg1Value) | ||
| { | ||
| Order = order; | ||
| Descriptor = new ContractEventDescriptor() | ||
| { | ||
| Name = name, | ||
| Parameters = new ContractParameterDefinition[] | ||
| { | ||
| Parameters = | ||
| [ | ||
| new ContractParameterDefinition() | ||
| { | ||
| Name = arg1Name, | ||
| Type = arg1Value | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
| } | ||
|
|
||
| public ContractEventAttribute(int order, string name, string arg1Name, ContractParameterType arg1Value, Hardfork deprecatedIn) | ||
| : this(order, name, arg1Name, arg1Value) | ||
| { | ||
| DeprecatedIn = deprecatedIn; | ||
| } | ||
shargon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public ContractEventAttribute(Hardfork activeIn, int order, string name, | ||
| string arg1Name, ContractParameterType arg1Value, | ||
| string arg2Name, ContractParameterType arg2Value) : this(order, name, arg1Name, arg1Value, arg2Name, arg2Value) | ||
|
|
@@ -61,8 +74,8 @@ public ContractEventAttribute(int order, string name, | |
| Descriptor = new ContractEventDescriptor() | ||
| { | ||
| Name = name, | ||
| Parameters = new ContractParameterDefinition[] | ||
| { | ||
| Parameters = | ||
| [ | ||
| new ContractParameterDefinition() | ||
| { | ||
| Name = arg1Name, | ||
|
|
@@ -73,7 +86,7 @@ public ContractEventAttribute(int order, string name, | |
| Name = arg2Name, | ||
| Type = arg2Value | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
| } | ||
|
|
||
|
|
@@ -95,8 +108,8 @@ public ContractEventAttribute(int order, string name, | |
| Descriptor = new ContractEventDescriptor() | ||
| { | ||
| Name = name, | ||
| Parameters = new ContractParameterDefinition[] | ||
| { | ||
| Parameters = | ||
| [ | ||
| new ContractParameterDefinition() | ||
| { | ||
| Name = arg1Name, | ||
|
|
@@ -112,7 +125,7 @@ public ContractEventAttribute(int order, string name, | |
| Name = arg3Name, | ||
| Type = arg3Value | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
| } | ||
|
|
||
|
|
@@ -136,8 +149,8 @@ public ContractEventAttribute(int order, string name, | |
| Descriptor = new ContractEventDescriptor() | ||
| { | ||
| Name = name, | ||
| Parameters = new ContractParameterDefinition[] | ||
| { | ||
| Parameters = | ||
| [ | ||
| new ContractParameterDefinition() | ||
| { | ||
| Name = arg1Name, | ||
|
|
@@ -158,7 +171,7 @@ public ContractEventAttribute(int order, string name, | |
| Name = arg4Name, | ||
| Type = arg4Value | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // Copyright (C) 2015-2024 The Neo Project. | ||
| // | ||
| // IHardforkActivable.cs file belongs to the neo project and is free | ||
| // software distributed under the MIT software license, see the | ||
| // accompanying file LICENSE in the main directory of the | ||
| // repository or http://www.opensource.org/licenses/mit-license.php | ||
| // for more details. | ||
| // | ||
| // Redistribution and use in source and binary forms with or without | ||
| // modifications are permitted. | ||
|
|
||
| namespace Neo.SmartContract.Native | ||
| { | ||
| internal interface IHardforkActivable | ||
| { | ||
| public Hardfork? ActiveIn { get; } | ||
| public Hardfork? DeprecatedIn { get; } | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.