fn: slot hash id must be utf8 in gRPC (#1016)

This commit is contained in:
Tolga Ceylan
2018-05-29 16:26:43 -07:00
committed by GitHub
parent 47c6fb54af
commit 7f1d14d21f
2 changed files with 9 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import (
"context"
"crypto/tls"
"crypto/x509"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
@@ -537,7 +538,12 @@ func (pr *pureRunner) handleTryCall(tc *runner.TryCall, state *callHandle) error
state.c = agent_call.(*call)
if tc.SlotHashId != "" {
state.c.slotHashId = tc.SlotHashId
hashId, err := hex.DecodeString(tc.SlotHashId)
if err != nil {
state.enqueueCallResponse(err)
return err
}
state.c.slotHashId = string(hashId[:])
}
state.allocatedTime = strfmt.DateTime(time.Now())
pr.spawnSubmit(state)