@@ -35,7 +35,7 @@ var txnre = regexp.MustCompile("([a-zA-Z0-9.]*)/txn/([0-9]*)")
35
35
var queryre = regexp.MustCompile("([a-zA-Z0-9.]*)/query/([0-9]*)")
36
36
37
37
// Initialization function, called only once
38
- func (self *stubHandler) Init(stub * shim.ChaincodeStub , function string, args []string) ([]byte, error) {
38
+ func (self *stubHandler) Init(stub shim.ChaincodeStubInterface , function string, args []string) ([]byte, error) {
39
39
40
40
if len(args) != 1 {
41
41
return nil, errors.New("Expected exactly one argument")
@@ -146,8 +146,8 @@ import (
146
146
)
147
147
148
148
type Dispatcher interface {
149
- DispatchTxn(stub * shim.ChaincodeStub , function int, params string) ([]byte, error)
150
- DispatchQuery(stub * shim.ChaincodeStub , function int, params string) ([]byte, error)
149
+ DispatchTxn(stub shim.ChaincodeStubInterface , function int, params string) ([]byte, error)
150
+ DispatchQuery(stub shim.ChaincodeStubInterface , function int, params string) ([]byte, error)
151
151
}
152
152
153
153
type Factory interface {
@@ -206,7 +206,7 @@ var facts = &meta.Facts {
206
206
type ChaincodeMetaData struct {
207
207
}
208
208
209
- func (self *ChaincodeMetaData) GetInterfaces(stub * shim.ChaincodeStub , params *meta.GetInterfacesParams) (*meta.Interfaces, error) {
209
+ func (self *ChaincodeMetaData) GetInterfaces(stub shim.ChaincodeStubInterface , params *meta.GetInterfacesParams) (*meta.Interfaces, error) {
210
210
211
211
response := &meta.Interfaces{}
212
212
for name, data := range interfaces {
@@ -222,7 +222,7 @@ func (self *ChaincodeMetaData) GetInterfaces(stub *shim.ChaincodeStub, params *m
222
222
return response, nil
223
223
}
224
224
225
- func (self *ChaincodeMetaData) GetInterface(stub * shim.ChaincodeStub , params *meta.GetInterfaceParams) (*meta.InterfaceDescriptor, error) {
225
+ func (self *ChaincodeMetaData) GetInterface(stub shim.ChaincodeStubInterface , params *meta.GetInterfaceParams) (*meta.InterfaceDescriptor, error) {
226
226
227
227
intf, ok := interfaces[params.Name]
228
228
if !ok {
@@ -232,7 +232,7 @@ func (self *ChaincodeMetaData) GetInterface(stub *shim.ChaincodeStub, params *me
232
232
return &meta.InterfaceDescriptor{Data: intf}, nil
233
233
}
234
234
235
- func (self *ChaincodeMetaData) GetFacts(stub * shim.ChaincodeStub , params *meta.GetFactsParams) (*meta.Facts, error) {
235
+ func (self *ChaincodeMetaData) GetFacts(stub shim.ChaincodeStubInterface , params *meta.GetFactsParams) (*meta.Facts, error) {
236
236
237
237
return facts, nil
238
238
}
@@ -284,7 +284,7 @@ func (self *factoryImpl) Create(intf interface{}) (api.Dispatcher, error) {
284
284
return &stubImpl{intf: intf.(CCInterface)}, nil
285
285
}
286
286
287
- func (self *stubImpl) DispatchTxn(stub * shim.ChaincodeStub , function int, params string) ([]byte, error) {
287
+ func (self *stubImpl) DispatchTxn(stub shim.ChaincodeStubInterface , function int, params string) ([]byte, error) {
288
288
// Handle different functions
289
289
switch {
290
290
<dispatchfunctions(true, intf, intf.transactions)>
@@ -293,7 +293,7 @@ func (self *stubImpl) DispatchTxn(stub *shim.ChaincodeStub, function int, params
293
293
}
294
294
}
295
295
296
- func (self *stubImpl) DispatchQuery(stub * shim.ChaincodeStub , function int, params string) ([]byte, error) {
296
+ func (self *stubImpl) DispatchQuery(stub shim.ChaincodeStubInterface , function int, params string) ([]byte, error) {
297
297
// Handle different functions
298
298
switch {
299
299
<dispatchfunctions(true, intf, intf.queries)>
@@ -352,7 +352,7 @@ dispatchfunctions(txn, intf, functions) ::= "<functions.values:{x | <dispatchfun
352
352
353
353
declarefunctions(intf, functions) ::=
354
354
<<
355
- <functions.values:{x | <x.name>(* shim.ChaincodeStub <if(x.param)>, *<x.param><endif>) <if(x.rettype)>(*<x.rettype>, error)<else>error<endif> }; separator="\n">
355
+ <functions.values:{x | <x.name>(shim.ChaincodeStubInterface <if(x.param)>, *<x.param><endif>) <if(x.rettype)>(*<x.rettype>, error)<else>error<endif> }; separator="\n">
356
356
>>
357
357
358
358
dispatchfunction(txn, intf, func) ::=
@@ -363,7 +363,7 @@ case function == <func.index>:
363
363
364
364
implementhandler(txn) ::=
365
365
<<
366
- func (self *stubHandler) <if(txn)>Invoke<else>Query<endif>(stub * shim.ChaincodeStub , function string, args []string) ([]byte, error) {
366
+ func (self *stubHandler) <if(txn)>Invoke<else>Query<endif>(stub shim.ChaincodeStubInterface , function string, args []string) ([]byte, error) {
367
367
368
368
var params string;
369
369
@@ -383,7 +383,7 @@ func (self *stubHandler) <if(txn)>Invoke<else>Query<endif>(stub *shim.ChaincodeS
383
383
implementserver(intf, func) ::=
384
384
<<
385
385
386
- func (self *stubImpl) proxy<func.name>(stub * shim.ChaincodeStub , _params string) ([]byte, error) {
386
+ func (self *stubImpl) proxy<func.name>(stub shim.ChaincodeStubInterface , _params string) ([]byte, error) {
387
387
388
388
var err error;
389
389
@@ -421,7 +421,7 @@ func (self *stubImpl) proxy<func.name>(stub *shim.ChaincodeStub, _params string)
421
421
implementclient(txn, intf, func) ::=
422
422
<<
423
423
424
- func <func.name>(stub * shim.ChaincodeStub , chaincodeName string<if(func.param)>, params *<func.param><endif>) <\\>
424
+ func <func.name>(stub shim.ChaincodeStubInterface , chaincodeName string<if(func.param)>, params *<func.param><endif>) <\\>
425
425
<if(func.rettype)>(*<func.rettype>, error)<else>error<endif> {
426
426
427
427
args := make([]string, 1)
0 commit comments