mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 19:02:28 +00:00
core: allow to use state root in header
This commit is contained in:
parent
3025b42c65
commit
1869d6d460
37 changed files with 349 additions and 124 deletions
|
@ -83,7 +83,7 @@ func (c *Client) getBlock(params request.RawParams) (*block.Block, error) {
|
|||
return nil, err
|
||||
}
|
||||
r := io.NewBinReaderFromBuf(resp)
|
||||
b = block.New(c.GetNetwork())
|
||||
b = block.New(c.GetNetwork(), c.StateRootInHeader())
|
||||
b.DecodeBinary(r)
|
||||
if r.Err != nil {
|
||||
return nil, r.Err
|
||||
|
@ -606,6 +606,11 @@ func (c *Client) GetNetwork() netmode.Magic {
|
|||
return c.network
|
||||
}
|
||||
|
||||
// StateRootInHeader returns true if state root is contained in block header.
|
||||
func (c *Client) StateRootInHeader() bool {
|
||||
return c.stateRootInHeader
|
||||
}
|
||||
|
||||
// GetNativeContractHash returns native contract hash by its name. It is not case-sensitive.
|
||||
func (c *Client) GetNativeContractHash(name string) (util.Uint160, error) {
|
||||
lowercasedName := strings.ToLower(name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue