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

Function insert_proof_exact

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

Source from the content-addressed store, hash-verified

57}
58
59func insert_proof_exact(t *testing.T) {
60 pubkey, _ := crypto.StringToPubkey(persona)
61 personaPk, _ := crypto.GenerateKeypair()
62 validators := []validator.Base{
63 {
64 Platform: types.Platforms.Twitter,
65 Previous: "",
66 Action: types.Actions.Create,
67 Pubkey: pubkey,
68 Identity: "yeiwb",
69 ProofLocation: "1469221200140574721",
70 Signature: []byte{1},
71 CreatedAt: time.Date(1970, time.Month(1), 1, 0, 0, 0, 0, time.UTC),
72 },
73 {
74 Platform: types.Platforms.Ethereum,
75 Previous: "AQ==",
76 Action: types.Actions.Create,
77 Pubkey: pubkey,
78 Identity: "0xd5f630652d4a8a5f95cda3738ce9f43fa26e764f",
79 ProofLocation: "",
80 Signature: []byte{2},
81 Extra: map[string]string{
82 "ethereum_pubkey": "0x04ae5933a45605e7fff23cd010455911c1f0194479438859af5140d749937e53fd935d768efa9229ae8be3314631e945c56f915778ad4565b4efafcd13864e2fd7",
83 },
84 CreatedAt: time.Date(1971, time.Month(1), 1, 0, 0, 0, 0, time.UTC),
85 },
86 {
87 Platform: types.Platforms.Twitter,
88 Previous: "",
89 Action: types.Actions.Create,
90 Pubkey: personaPk,
91 Identity: "yeiwb_fuzzy",
92 ProofLocation: "1469221200140574722",
93 Signature: []byte{3},
94 CreatedAt: time.Date(2022, time.Month(1), 1, 0, 0, 0, 0, time.UTC),
95 },
96 }
97
98 for _, b := range validators {
99 pc, err := model.ProofChainCreateFromValidator(&b)
100 require.Nil(t, err)
101
102 err = pc.Apply()
103 require.Nil(t, err)
104 }
105}
106
107// / Insert Random Persona <-> Given ETH public key binding.
108func insert_eth_proof(t *testing.T, eth_pub_key *ecdsa.PublicKey) {

Callers 1

Test_proofQueryFunction · 0.85

Calls 4

StringToPubkeyFunction · 0.92
GenerateKeypairFunction · 0.92
ApplyMethod · 0.80

Tested by

no test coverage detected