Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into tzdybal/tx_injector
Browse files Browse the repository at this point in the history
  • Loading branch information
tzdybal committed Feb 20, 2025
2 parents 4c257e1 + ae86f69 commit 218307c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
**/**.go
go.mod
go.sum
- uses: golangci/golangci-lint-action@v6.3.2
- uses: golangci/golangci-lint-action@v6.5.0
with:
version: latest
args: --timeout 10m
Expand Down
6 changes: 4 additions & 2 deletions proxy/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ func (c *Client) InitChain(ctx context.Context, genesisTime time.Time, initialHe
return types.Hash{}, 0, err
}

stateRoot := copyHash(resp.StateRoot)
stateRoot := make([]byte, len(resp.StateRoot))
copy(stateRoot[:], resp.StateRoot)

return stateRoot, resp.MaxBytes, nil
}
Expand Down Expand Up @@ -98,7 +99,8 @@ func (c *Client) ExecuteTxs(ctx context.Context, txs []types.Tx, blockHeight uin
return types.Hash{}, 0, err
}

updatedStateRoot := copyHash(resp.UpdatedStateRoot)
updatedStateRoot := make([]byte, len(resp.UpdatedStateRoot))
copy(updatedStateRoot[:], resp.UpdatedStateRoot)

return updatedStateRoot, resp.MaxBytes, nil
}
Expand Down
3 changes: 2 additions & 1 deletion proxy/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ func (s *Server) ExecuteTxs(ctx context.Context, req *pb.ExecuteTxsRequest) (*pb
txs[i] = tx
}

prevStateRoot := copyHash(req.PrevStateRoot)
prevStateRoot := make([]byte, len(req.PrevStateRoot))
copy(prevStateRoot[:], req.PrevStateRoot)

updatedStateRoot, maxBytes, err := s.exec.ExecuteTxs(
ctx,
Expand Down

0 comments on commit 218307c

Please sign in to comment.