Make Counter app return nil hash initially
This commit is contained in:
parent
7b1ebb9245
commit
21abda0602
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue