MCPcopy Create free account
hub / github.com/CPChain/chain / CopyTrie

Method CopyTrie

core/state/database.go:128–137  ·  view source on GitHub ↗

CopyTrie returns an independent copy of the given trie.

(t Trie)

Source from the content-addressed store, hash-verified

126
127// CopyTrie returns an independent copy of the given trie.
128func (db *cachingDB) CopyTrie(t Trie) Trie {
129 switch t := t.(type) {
130 case cachedTrie:
131 return cachedTrie{t.SecureTrie.Copy(), db}
132 case *trie.SecureTrie:
133 return t.Copy()
134 default:
135 panic(fmt.Errorf("unknown trie type %T", t))
136 }
137}
138
139// ContractCode retrieves a particular contract's code.
140func (db *cachingDB) ContractCode(addrHash, codeHash common.Hash) ([]byte, error) {

Callers

nothing calls this directly

Calls 1

CopyMethod · 0.45

Tested by

no test coverage detected