Skip to content

Commit

Permalink
Native: store ID->hash mapping for native contracts too (#2833)
Browse files Browse the repository at this point in the history
This is an omission of #2807, even though native hashes are well-known
GetContractById better be symmetric for all contracts. Related to
nspcc-dev/neo-go#2837.

Co-authored-by: Shargon <shargon@gmail.com>
  • Loading branch information
roman-khimov and shargon authored Jan 7, 2023
1 parent ee93a8d commit bf5dcba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Neo/SmartContract/Native/ContractManagement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ internal override async ContractTask OnPersist(ApplicationEngine engine)
Hash = contract.Hash,
Manifest = contract.Manifest
}));
engine.Snapshot.Add(CreateStorageKey(Prefix_ContractHash).AddBigEndian(contract.Id), new StorageItem(contract.Hash.ToArray()));
await contract.Initialize(engine);
}
}
Expand Down

0 comments on commit bf5dcba

Please sign in to comment.