MCPcopy
hub / github.com/canopy-network/canopy / IsValidDoubleSigner

Method IsValidDoubleSigner

controller/controller.go:235–247  ·  view source on GitHub ↗

IsValidDoubleSigner() checks if the double signer is valid at a certain double sign height

(rootChainId, rootHeight uint64, address []byte)

Source from the content-addressed store, hash-verified

233
234// IsValidDoubleSigner() checks if the double signer is valid at a certain double sign height
235func (c *Controller) IsValidDoubleSigner(rootChainId, rootHeight uint64, address []byte) bool {
236 // do a remote call to the root chain to see if the double signer is valid
237 isValidDoubleSigner, err := c.RCManager.IsValidDoubleSigner(rootChainId, rootHeight, lib.BytesToString(address))
238 // if an error occurred during the remote call
239 if err != nil {
240 // log the error
241 c.log.Errorf("IsValidDoubleSigner failed with error: %s", err.Error())
242 // return is not a valid double signer for safety
243 return false
244 }
245 // return the result from the remote call
246 return *isValidDoubleSigner
247}
248
249// PLUGIN CALLS BELOW
250

Callers

nothing calls this directly

Calls 4

BytesToStringFunction · 0.92
IsValidDoubleSignerMethod · 0.65
ErrorfMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected