Skip to content

Commit

Permalink
Merge branch 'dev' into tyler/res-579-due-diligence-on-rewards
Browse files Browse the repository at this point in the history
Signed-off-by: Kenny P <17100641+kpeluso@users.noreply.github.com>
  • Loading branch information
kpeluso authored Dec 18, 2024
2 parents 9385a19 + fbc4d9c commit a327ba4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#704](https://github.com/allora-network/allora-chain/pull/704) Correct Discrepancies with Whitepaper modified reward fractions vs plain EMA
* [#700](https://github.com/allora-network/allora-chain/pull/700) Allow clients to unmarshall old transactions
* [#711](https://github.com/allora-network/allora-chain/pull/711) Set research-approved default module param values
* [#713](https://github.com/allora-network/allora-chain/pull/713) Proto generation keeps codec.go files

### Security

Expand Down
24 changes: 24 additions & 0 deletions x/emissions/scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

set -e

# Backup codec.go files WITH their directory structure - dynamically find all v* folders
echo "Starting backup of codec.go files..."
mkdir -p codec_backup/api/emissions
for vdir in api/emissions/v*; do
if [ -f "$vdir/codec.go" ]; then
version=$(basename $vdir)
mkdir -p "codec_backup/api/emissions/$version"
cp "$vdir/codec.go" "codec_backup/api/emissions/$version/"
echo "Backed up: $vdir/codec.go"
fi
done
echo "Backup complete"

echo "Generating gogo proto code"
cd proto
proto_dirs=$(find . -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
Expand All @@ -21,8 +34,19 @@ buf generate --template buf.gen.pulsar.yaml

cd ..

echo "Copying generated files..."
cp -r github.com/allora-network/allora-chain/x/emissions/* ./
echo "Removing old api directory..."
rm -rf api && mkdir api
echo "Moving emissions directory..."
mv emissions ./api
rm -rf emissions/
rm -rf github.com allora-network

# Restore codec.go files with their directory structure
echo "Restoring codec.go files..."
cp -r codec_backup/api/* ./api/
echo "Restored codec.go files"
echo "Cleaning up backup directory..."
rm -rf codec_backup
echo "Done!"

0 comments on commit a327ba4

Please sign in to comment.