-
Notifications
You must be signed in to change notification settings - Fork 1k
Merge NativeUpdateHistory with HardForks #2941
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 2 commits
aaa9cbe
7869c9f
4788421
a1d1692
4c22d0a
05ea58d
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 |
|---|---|---|
|
|
@@ -106,18 +106,18 @@ internal override async ContractTask OnPersist(ApplicationEngine engine) | |
| { | ||
| foreach (NativeContract contract in Contracts) | ||
| { | ||
| uint[] updates = engine.ProtocolSettings.NativeUpdateHistory[contract.Name]; | ||
| if (updates.Length == 0 || updates[0] != engine.PersistingBlock.Index) | ||
| continue; | ||
| engine.Snapshot.Add(CreateStorageKey(Prefix_Contract).Add(contract.Hash), new StorageItem(new ContractState | ||
| if (contract.IsInitializeBlock(engine.ProtocolSettings, engine.PersistingBlock.Index)) | ||
|
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. How to update contracts with this? 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. That's the next step, this pr is only for merge the logics,but I want to create the manifest according to the 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. That is good. It will be a great improvement. |
||
| { | ||
| Id = contract.Id, | ||
| Nef = contract.Nef, | ||
| Hash = contract.Hash, | ||
| Manifest = contract.Manifest | ||
| })); | ||
| engine.Snapshot.Add(CreateStorageKey(Prefix_ContractHash).AddBigEndian(contract.Id), new StorageItem(contract.Hash.ToArray())); | ||
| await contract.Initialize(engine); | ||
| engine.Snapshot.Add(CreateStorageKey(Prefix_Contract).Add(contract.Hash), new StorageItem(new ContractState | ||
| { | ||
| Id = contract.Id, | ||
| Nef = contract.Nef, | ||
| Hash = contract.Hash, | ||
| Manifest = contract.Manifest | ||
| })); | ||
| engine.Snapshot.Add(CreateStorageKey(Prefix_ContractHash).AddBigEndian(contract.Id), new StorageItem(contract.Hash.ToArray())); | ||
| await contract.Initialize(engine); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.