github.com/s7techlab/cckit@v0.10.5/extensions/owner/handler.go (about)

     1  package owner
     2  
     3  import (
     4  	"github.com/s7techlab/cckit/router"
     5  )
     6  
     7  const QueryMethod = `owner`
     8  
     9  // Query returns raw data (serialized Grant) of current chain code owner
    10  func Query(c router.Context) (interface{}, error) {
    11  	return c.State().Get(OwnerStateKey)
    12  }
    13  
    14  // InvokeSetFromCreator sets tx creator as chaincode owner, if owner not previously set
    15  func InvokeSetFromCreator(c router.Context) (interface{}, error) {
    16  	return SetFromCreator(c)
    17  }
    18  
    19  // InvokeSetFromArgs gets owner data from args[0] (Msp Id) and arg[1] (cert)
    20  func InvokeSetFromArgs(c router.Context) (interface{}, error) {
    21  	return SetFromArgs(c)
    22  }