|
|
@ -68,10 +68,14 @@ func (appC *CounterAppContext) AppendTx(tx []byte) ([]types.Event, types.RetCode |
|
|
|
} |
|
|
|
|
|
|
|
func (appC *CounterAppContext) GetHash() ([]byte, types.RetCode) { |
|
|
|
hash := make([]byte, 32) |
|
|
|
binary.PutVarint(hash, int64(appC.txCount)) |
|
|
|
appC.hashCount += 1 |
|
|
|
return hash, 0 |
|
|
|
if appC.txCount == 0 { |
|
|
|
return nil, 0 |
|
|
|
} else { |
|
|
|
hash := make([]byte, 32) |
|
|
|
binary.PutVarint(hash, int64(appC.txCount)) |
|
|
|
return hash, 0 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func (appC *CounterAppContext) Commit() types.RetCode { |
|
|
|