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

Function insert_eth_proof

controller/proof_query_test.go:108–126  ·  view source on GitHub ↗

Insert Random Persona <-> Given ETH public key binding.

(t *testing.T, eth_pub_key *ecdsa.PublicKey)

Source from the content-addressed store, hash-verified

106
107// / Insert Random Persona <-> Given ETH public key binding.
108func insert_eth_proof(t *testing.T, eth_pub_key *ecdsa.PublicKey) {
109 personaPk, _ := crypto.GenerateKeypair()
110 validator := validator.Base{
111 Platform: types.Platforms.Ethereum,
112 Previous: "",
113 Action: types.Actions.Create,
114 Pubkey: personaPk,
115 Identity: strings.ToLower(ethcrypto.PubkeyToAddress(*eth_pub_key).String()),
116 ProofLocation: "",
117 Signature: []byte{1},
118 SignaturePayload: "",
119 Text: "",
120 Extra: map[string]string{},
121 }
122 pc, err := model.ProofChainCreateFromValidator(&validator)
123 require.Nil(t, err)
124 err = pc.Apply()
125 require.Nil(t, err)
126}
127
128func Test_proofQuery(t *testing.T) {
129 t.Run("smoke", func(t *testing.T) {

Callers 1

Test_proofQueryFunction · 0.85

Calls 3

GenerateKeypairFunction · 0.92
ApplyMethod · 0.80

Tested by

no test coverage detected