Skip to content

Commit

Permalink
adm: add support for the new neofs-contract archives
Browse files Browse the repository at this point in the history
As a part of nspcc-dev/neofs-contract#384 I'd like
to unify different code dealing with them.

Signed-off-by: Roman Khimov <[email protected]>
  • Loading branch information
roman-khimov committed Jun 14, 2024
1 parent 450c4e5 commit fe32e41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog for NeoFS Node
## [Unreleased]

### Added
- Support for 0.20.0+ neofs-contract archive format (#2872)

### Fixed

Expand Down
10 changes: 8 additions & 2 deletions cmd/neofs-adm/internal/modules/morph/initialize_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,17 @@ func (c *initializeContext) readContracts(names []string) error {
func readContract(ctrPath, ctrName string) (*contractState, error) {
rawNef, err := os.ReadFile(filepath.Join(ctrPath, ctrName+"_contract.nef"))
if err != nil {
return nil, fmt.Errorf("can't read NEF file for %s contract: %w", ctrName, err)
rawNef, err = os.ReadFile(filepath.Join(ctrPath, "contract.nef"))
if err != nil {
return nil, fmt.Errorf("can't read NEF file for %s contract: %w", ctrName, err)

Check warning on line 377 in cmd/neofs-adm/internal/modules/morph/initialize_deploy.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-adm/internal/modules/morph/initialize_deploy.go#L375-L377

Added lines #L375 - L377 were not covered by tests
}
}
rawManif, err := os.ReadFile(filepath.Join(ctrPath, "config.json"))
if err != nil {
return nil, fmt.Errorf("can't read manifest file for %s contract: %w", ctrName, err)
rawManif, err = os.ReadFile(filepath.Join(ctrPath, "manifest.json"))
if err != nil {
return nil, fmt.Errorf("can't read manifest file for %s contract: %w", ctrName, err)

Check warning on line 384 in cmd/neofs-adm/internal/modules/morph/initialize_deploy.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-adm/internal/modules/morph/initialize_deploy.go#L382-L384

Added lines #L382 - L384 were not covered by tests
}
}

cs := &contractState{
Expand Down

0 comments on commit fe32e41

Please sign in to comment.