-
Notifications
You must be signed in to change notification settings - Fork 1k
[Add] GetBlockedAccounts to Policy Contract
#4147
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
Changes from 14 commits
29eeab5
21de78c
092e565
5ded4c4
a14e19b
eec94fc
9f41dab
ba60781
efde09e
a97af3b
1884ae5
08004f6
2956b8e
01e895e
9f1ead6
a50598d
07cbf37
3c9c4eb
f68ccff
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 | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,9 +11,9 @@ | |||||||
|
|
||||||||
| #pragma warning disable IDE0051 | ||||||||
|
|
||||||||
| using Akka.Dispatch; | ||||||||
| using Neo.Network.P2P.Payloads; | ||||||||
| using Neo.Persistence; | ||||||||
| using Neo.SmartContract.Iterators; | ||||||||
| using System; | ||||||||
| using System.Numerics; | ||||||||
|
|
||||||||
|
|
@@ -418,5 +418,16 @@ private bool UnblockAccount(ApplicationEngine engine, UInt160 account) | |||||||
| engine.SnapshotCache.Delete(key); | ||||||||
| return true; | ||||||||
| } | ||||||||
|
|
||||||||
| [ContractMethod(Hardfork.HF_Faun, CpuFee = 1 << 15, RequiredCallFlags = CallFlags.ReadStates)] | ||||||||
| private StorageIterator GetBlockedAccounts(ApplicationEngine engine) | ||||||||
|
||||||||
| private IIterator GetAllCandidates(IReadOnlyStore snapshot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Code consistency is more important to me here as well, this method is not on a hot path to care about nanoseconds.
- Things like and
if (item is InteropInterface interopInterface && interopInterface.GetInterface<object>() is IIterator iterator) are somewhat fragile wrt inconsistent type use (although should survive in this particular case).private static ContractParameterType ToParameterType(Type type)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StorageIterator inherits IIterator it won't matter if you use IIterator in a statement. However using StorageIterator in interopInterface.GetInterface<object>() is StorageIterator iterator would matter. So we are safe here.

Uh oh!
There was an error while loading. Please reload this page.