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

Function TestSetNonce

core/state/managed_state_test.go:107–123  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

105}
106
107func TestSetNonce(t *testing.T) {
108 ms, _ := create()
109
110 var addr common.Address
111 ms.SetNonce(addr, 10)
112
113 if ms.GetNonce(addr) != 10 {
114 t.Error("Expected nonce of 10, got", ms.GetNonce(addr))
115 }
116
117 addr[0] = 1
118 ms.StateDB.SetNonce(addr, 1)
119
120 if ms.GetNonce(addr) != 1 {
121 t.Error("Expected nonce of 1, got", ms.GetNonce(addr))
122 }
123}

Callers

nothing calls this directly

Calls 4

createFunction · 0.85
SetNonceMethod · 0.65
GetNonceMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected