From fc3acdc80c9f2c1e66ef8e133577512819b12597 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 20 May 2020 22:32:59 +0300 Subject: [PATCH] core: add native contracts' hashes getters --- pkg/core/blockchain.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index 8d0ab3a1e..18b5e90de 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -1721,6 +1721,16 @@ func (bc *Blockchain) verifyHeaderWitnesses(currHeader, prevHeader *block.Header return bc.verifyHashAgainstScript(hash, &currHeader.Script, interopCtx, true) } +// GoverningTokenHash returns the governing token (NEO) native contract hash. +func (bc *Blockchain) GoverningTokenHash() util.Uint160 { + return bc.contracts.NEO.Hash +} + +// UtilityTokenHash returns the utility token (GAS) native contract hash. +func (bc *Blockchain) UtilityTokenHash() util.Uint160 { + return bc.contracts.GAS.Hash +} + func hashAndIndexToBytes(h util.Uint256, index uint32) []byte { buf := io.NewBufBinWriter() buf.WriteBytes(h.BytesLE())