Skip to content

Commit 1fc6eb7

Browse files
authored
Merge branch 'dev' into remove-tx-mempool-verifier
2 parents cf3c653 + a120693 commit 1fc6eb7

File tree

13 files changed

+846
-43
lines changed

13 files changed

+846
-43
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "daily"
12-
target-branch: "dev"

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (C) 2019-2023, Ava Labs, Inc.
3+
Copyright (C) 2019-2024, Ava Labs, Inc.
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

header.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
header: |
2-
// Copyright (C) 2019-{{YEAR}}, Ava Labs, Inc. All rights reserved.
2+
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
33
// See the file LICENSE for licensing terms.
44

network/ip_tracker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
1+
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
22
// See the file LICENSE for licensing terms.
33

44
package network

scripts/mock.gen.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ fi
1616

1717
source ./scripts/constants.sh
1818

19+
outputted_files=()
20+
1921
# tuples of (source interface import path, comma-separated interface names, output file path)
2022
input="scripts/mocks.mockgen.txt"
2123
while IFS= read -r line
2224
do
2325
IFS='=' read src_import_path interface_name output_path <<< "${line}"
2426
package_name=$(basename $(dirname $output_path))
2527
echo "Generating ${output_path}..."
28+
outputted_files+=(${output_path})
2629
mockgen -package=${package_name} -destination=${output_path} ${src_import_path} ${interface_name}
2730

2831
done < "$input"
@@ -33,6 +36,7 @@ while IFS= read -r line
3336
do
3437
IFS='=' read source_path exclude_interfaces output_path <<< "${line}"
3538
package_name=$(basename $(dirname $output_path))
39+
outputted_files+=(${output_path})
3640
echo "Generating ${output_path}..."
3741

3842
mockgen \
@@ -43,4 +47,20 @@ do
4347

4448
done < "$input"
4549

50+
all_generated_files=( $(grep -Rl 'Code generated by MockGen. DO NOT EDIT.') )
51+
52+
# Exclude certain files
53+
outputted_files+=('scripts/mock.gen.sh') # This file
54+
outputted_files+=('vms/components/avax/mock_transferable_out.go') # Embedded verify.IsState
55+
outputted_files+=('vms/platformvm/fx/mock_fx.go') # Embedded verify.IsNotState
56+
57+
diff_files=(`echo ${all_generated_files[@]} ${outputted_files[@]} | tr ' ' '\n' | sort | uniq -u`)
58+
59+
if (( ${#diff_files[@]} )); then
60+
printf "\nFAILURE\n"
61+
echo "Detected MockGen generated files that are not in scripts/mocks.mockgen.source.txt or scripts/mocks.mockgen.txt:"
62+
printf "%s\n" "${diff_files[@]}"
63+
exit 255
64+
fi
65+
4666
echo "SUCCESS"

tests/fixture/tmpnet/network_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
1+
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
22
// See the file LICENSE for licensing terms.
33

44
package tmpnet

tests/fixture/tmpnet/subnet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
1+
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
22
// See the file LICENSE for licensing terms.
33

44
package tmpnet

utils/bloom/filter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func (f *Filter) Add(hash uint64) {
6363
f.lock.Lock()
6464
defer f.lock.Unlock()
6565

66+
_ = 1 % f.numBits // hint to the compiler that numBits is not 0
6667
for _, seed := range f.hashSeeds {
6768
hash = bits.RotateLeft64(hash, hashRotation) ^ seed
6869
index := hash % f.numBits
@@ -119,6 +120,7 @@ func newHashSeeds(count int) ([]uint64, error) {
119120
func contains(hashSeeds []uint64, entries []byte, hash uint64) bool {
120121
var (
121122
numBits = bitsPerByte * uint64(len(entries))
123+
_ = 1 % numBits // hint to the compiler that numBits is not 0
122124
accumulator byte = 1
123125
)
124126
for seedIndex := 0; seedIndex < len(hashSeeds) && accumulator != 0; seedIndex++ {

utils/filesystem/mock_file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
1+
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
22
// See the file LICENSE for licensing terms.
33

44
package filesystem

vms/components/avax/mock_transferable_out.go

Lines changed: 18 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)