Skip to content

Commit

Permalink
fix merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
millken committed Oct 8, 2021
1 parent 8b1d491 commit 9bbf5e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
11 changes: 3 additions & 8 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,6 @@ func (api *Server) ReadContract(ctx context.Context, in *iotexapi.ReadContractRe
}
callerAddr, _ := address.FromString(in.CallerAddress)
ctx, err = api.bc.Context(ctx)
if err != nil {
return
}
callerAddr, _ := address.FromString(in.CallerAddress)
ctx, err = api.bc.Context(ctx)
if err != nil {
return nil, err
}
Expand All @@ -511,14 +506,14 @@ func (api *Server) ReadContract(ctx context.Context, in *iotexapi.ReadContractRe
}
// ReadContract() is read-only, if no error returned, we consider it a success
receipt.Status = uint64(iotextypes.ReceiptStatus_Success)
res := iotexapi.ReadContractResponse{
res = &iotexapi.ReadContractResponse{
Data: hex.EncodeToString(retval),
Receipt: receipt.ConvertToReceiptPb(),
}
if d, err := proto.Marshal(&res); err == nil {
if d, err := proto.Marshal(res); err == nil {
api.readCache.Put(key, d)
}
return &res, nil
return res, nil
}

// ReadState reads state on blockchain
Expand Down
13 changes: 0 additions & 13 deletions blocksync/blocksync.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,6 @@ func (bs *blockSyncer) ProcessBlock(ctx context.Context, peer string, blk *block
bs.lastTip = syncedHeight
bs.lastTipUpdateTime = time.Now()
}
syncedHeight := tip
for {
if !bs.commitBlocks(bs.buf.Delete(syncedHeight + 1)) {
break
}
syncedHeight++
}
bs.buf.Cleanup(syncedHeight)
log.L().Debug("flush blocks", zap.Uint64("start", tip), zap.Uint64("end", syncedHeight))
if syncedHeight > bs.lastTip {
bs.lastTip = syncedHeight
bs.lastTipUpdateTime = time.Now()
}
return nil
}

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
Expand Down Expand Up @@ -1512,6 +1513,7 @@ google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
Expand Down

0 comments on commit 9bbf5e5

Please sign in to comment.