MCPcopy Create free account
hub / github.com/DNAProject/DNA / TestGetProgramInfo

Function TestGetProgramInfo

core/program/program_test.go:44–61  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42}
43
44func TestGetProgramInfo(t *testing.T) {
45 N := 10
46 M := N / 2
47 var pubkeys []keypair.PublicKey
48 for i := 0; i < N; i++ {
49 _, key, _ := keypair.GenerateKeyPair(keypair.PK_ECDSA, keypair.P256)
50 pubkeys = append(pubkeys, key)
51 }
52
53 pubkeys = keypair.SortPublicKeys(pubkeys)
54 progInfo := ProgramInfo{PubKeys: pubkeys, M: uint16(M)}
55 prog, err := ProgramFromMultiPubKey(progInfo.PubKeys, int(progInfo.M))
56 assert.Nil(t, err)
57
58 info2, err := GetProgramInfo(prog)
59 assert.Nil(t, err)
60 assert.Equal(t, progInfo, info2)
61}

Callers

nothing calls this directly

Calls 2

ProgramFromMultiPubKeyFunction · 0.85
GetProgramInfoFunction · 0.85

Tested by

no test coverage detected