From 89c3f4e13da174f56bd5a4d94ff7784be38f6ec5 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 23 Mar 2023 13:01:49 +0100 Subject: [PATCH] chore: set codecov targets (#1947) * chore: set codecov targets * update --- codecov.yml | 24 ++++++++++-------------- util/bytes.go | 2 ++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/codecov.yml b/codecov.yml index 4427c24e6e..696fef7d7a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,27 +1,23 @@ coverage: precision: 2 round: down - range: 70...100 + range: 60...100 status: # Learn more at https://docs.codecov.io/docs/commit-status project: default: - target: auto - threshold: 2% # # allow this much decrease on project + target: 65.5% + threshold: 2% # allow this much decrease on project if_ci_failed: error - if_not_found: success - app: - target: 70% - paths: - - "app/" + if_not_found: success # if tests are not run modules: - target: 70% + target: 62% paths: - "x/" - "!x/**/client/" # ignore client package client: - target: 70% + target: 96% paths: - client - "x/**/client/" @@ -32,19 +28,19 @@ comment: require_changes: true ignore: -# ignore all files of these types + # ignore all files of these types - "**/*.proto" - "**/*.yml" - "**/*.json" - "**/*.toml" - "**/*.rst" - "**/*.md" -# auto-generated files + # auto-generated files - "**/*.pb.go" - "**/*.pb.gw.go" -# ignore these folders and all their contents + # ignore these folders and all their contents - "docs" - "tests" - "scripts" - "contrib" - - "swagger" \ No newline at end of file + - "swagger" diff --git a/util/bytes.go b/util/bytes.go index f4ae18dc24..c6380b1cc2 100644 --- a/util/bytes.go +++ b/util/bytes.go @@ -20,6 +20,8 @@ func ConcatBytes(margin int, bzs ...[]byte) []byte { return out } +// UintWithNullPrefix efficiently serializes uint using LittleEndian and +// prepends zero byte (null prefix). func UintWithNullPrefix(n uint64) []byte { bz := make([]byte, 9) binary.LittleEndian.PutUint64(bz[1:], n)