MCPcopy Index your code
hub / github.com/chain/Core / TestValidateBlockForSig

Function TestValidateBlockForSig

protocol/block_test.go:196–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

194}
195
196func TestValidateBlockForSig(t *testing.T) {
197 initialBlock, err := NewInitialBlock(testutil.TestPubs, 1, time.Now())
198 if err != nil {
199 t.Fatal("unexpected error ", err)
200 }
201
202 ctx := context.Background()
203 c, err := NewChain(ctx, initialBlock.Hash(), memstore.New(), nil)
204 if err != nil {
205 t.Fatal("unexpected error ", err)
206 }
207
208 err = c.ValidateBlockForSig(ctx, initialBlock)
209 if err != nil {
210 t.Error("unexpected error ", err)
211 }
212}
213
214// newTestChain returns a new Chain using memstore for storage,
215// along with an initial block b1 (with a 0/0 multisig program).

Callers

nothing calls this directly

Calls 5

ValidateBlockForSigMethod · 0.95
NewInitialBlockFunction · 0.85
NewChainFunction · 0.70
HashMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected