Skip to content

Commit

Permalink
Merge branch 'main' into julien/autocli-any
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Nov 2, 2023
2 parents fd4a61d + b7749af commit 2900aa0
Show file tree
Hide file tree
Showing 77 changed files with 1,493 additions and 996 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### State Machine Breaking

* (x/gov) [#18146](https://github.com/cosmos/cosmos-sdk/pull/18146) Add denom check to reject denoms outside of those listed in `MinDeposit`. A new `MinDepositRatio` param is added (with a default value of `0.001`) and now deposits are required to be at least `MinDepositRatio*MinDeposit` to be accepted.
* (x/distribution) [#17657](https://github.com/cosmos/cosmos-sdk/pull/17657) Migrate community pool funds from x/distribution to x/protocolpool.
* (x/distribution) [#17115](https://github.com/cosmos/cosmos-sdk/pull/17115) Migrate `PreviousProposer` to collections.
* (x/upgrade) [#16244](https://github.com/cosmos/cosmos-sdk/pull/16244) upgrade module no longer stores the app version but gets and sets the app version stored in the `ParamStore` of baseapp.
Expand Down
151 changes: 117 additions & 34 deletions api/cosmos/gov/v1/gov.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 30 additions & 21 deletions client/snapshot/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,9 @@ func DumpArchiveCmd() *cobra.Command {

for i := uint32(0); i < snapshot.Chunks; i++ {
path := snapshotStore.PathChunk(height, uint32(format), i)
file, err := os.Open(path)
if err != nil {
return fmt.Errorf("failed to open chunk file %s: %w", path, err)
}
defer file.Close()

st, err := file.Stat()
if err != nil {
return fmt.Errorf("failed to stat chunk file %s: %w", path, err)
}

if err := tarWriter.WriteHeader(&tar.Header{
Name: strconv.FormatUint(uint64(i), 10),
Mode: 0o644,
Size: st.Size(),
}); err != nil {
return fmt.Errorf("failed to write chunk header to tar: %w", err)
}

if _, err := io.Copy(tarWriter, file); err != nil {
return fmt.Errorf("failed to write chunk to tar: %w", err)
tarName := strconv.FormatUint(uint64(i), 10)
if err := processChunk(tarWriter, path, tarName); err != nil {
return err
}
}

Expand All @@ -124,3 +106,30 @@ func DumpArchiveCmd() *cobra.Command {

return cmd
}

func processChunk(tarWriter *tar.Writer, path, tarName string) error {
file, err := os.Open(path)
if err != nil {
return fmt.Errorf("failed to open chunk file %s: %w", path, err)
}
defer file.Close()

st, err := file.Stat()
if err != nil {
return fmt.Errorf("failed to stat chunk file %s: %w", path, err)
}

if err := tarWriter.WriteHeader(&tar.Header{
Name: tarName,
Mode: 0o644,
Size: st.Size(),
}); err != nil {
return fmt.Errorf("failed to write chunk header to tar: %w", err)
}

if _, err := io.Copy(tarWriter, file); err != nil {
return fmt.Errorf("failed to write chunk to tar: %w", err)
}

return nil
}
Loading

0 comments on commit 2900aa0

Please sign in to comment.