MCPcopy Create free account
hub / github.com/NextDotID/proof_server / insert_proof

Function insert_proof

controller/proof_query_test.go:23–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21)
22
23func insert_proof(t *testing.T) {
24 pubkey, _ := crypto.StringToPubkey(persona)
25 validators := []validator.Base{
26 {
27 Platform: types.Platforms.Twitter,
28 Previous: "",
29 Action: types.Actions.Create,
30 Pubkey: pubkey,
31 Identity: "yeiwb",
32 ProofLocation: "1469221200140574721",
33 CreatedAt: time.Date(1970, time.Month(1), 1, 0, 0, 0, 0, time.UTC),
34 Signature: []byte{1},
35 },
36 {
37 Platform: types.Platforms.Ethereum,
38 Previous: "AQ==",
39 Action: types.Actions.Create,
40 Pubkey: pubkey,
41 Identity: "0xd5f630652d4a8a5f95cda3738ce9f43fa26e764f",
42 ProofLocation: "",
43 Signature: []byte{2},
44 Extra: map[string]string{
45 "ethereum_pubkey": "0x04ae5933a45605e7fff23cd010455911c1f0194479438859af5140d749937e53fd935d768efa9229ae8be3314631e945c56f915778ad4565b4efafcd13864e2fd7",
46 },
47 },
48 }
49
50 for _, b := range validators {
51 pc, err := model.ProofChainCreateFromValidator(&b)
52 require.Nil(t, err)
53
54 err = pc.Apply()
55 require.Nil(t, err)
56 }
57}
58
59func insert_proof_exact(t *testing.T) {
60 pubkey, _ := crypto.StringToPubkey(persona)

Callers 3

Test_proofExistsFunction · 0.85
Test_proofChainQueryFunction · 0.85
Test_proofQueryFunction · 0.85

Calls 3

StringToPubkeyFunction · 0.92
ApplyMethod · 0.80

Tested by

no test coverage detected