Skip to content

Commit

Permalink
Release v0.12.2
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Vanin <[email protected]>
  • Loading branch information
alexvanin committed Nov 26, 2021
1 parent a08d4c2 commit 621ce97
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 28 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Changelog
Changelog for NeoFS Contract

## [0.12.2] - 2021-11-26

### Fixed
- Domain owner check in container contract (#156)
- Missing NNS related keys in container contract (#181)

### Added
- Update functions now provide contract version in data (#164)

## [0.12.1] - 2021-10-19

### Fixed
Expand Down Expand Up @@ -245,6 +254,7 @@ Preview4-testnet version of NeoFS contracts.

Preview4 compatible contracts.

[0.12.2]: https://github.com/nspcc-dev/neofs-contract/compare/v0.12.1...v0.12.2
[0.12.1]: https://github.com/nspcc-dev/neofs-contract/compare/v0.12.0...v0.12.1
[0.12.0]: https://github.com/nspcc-dev/neofs-contract/compare/v0.11.0...v0.12.0
[0.11.0]: https://github.com/nspcc-dev/neofs-contract/compare/v0.10.1...v0.11.0
Expand Down
4 changes: 2 additions & 2 deletions common/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import "github.com/nspcc-dev/neo-go/pkg/interop/native/std"

const (
major = 0
minor = 13
patch = 0
minor = 12
patch = 2

// Versions from which an update should be performed.
// These should be used in a group (so prevMinor can be equal to minor if there are
Expand Down
27 changes: 1 addition & 26 deletions nns/nns_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/nspcc-dev/neo-go/pkg/interop/runtime"
"github.com/nspcc-dev/neo-go/pkg/interop/storage"
"github.com/nspcc-dev/neo-go/pkg/interop/util"
"github.com/nspcc-dev/neofs-contract/common"
)

// Prefixes used for contract data storage.
Expand Down Expand Up @@ -88,32 +89,6 @@ func Update(nef []byte, manifest string) {
// _deploy initializes defaults (total supply and registration price) on contract deploy.
func _deploy(data interface{}, isUpdate bool) {
if isUpdate {
ctx := storage.GetContext()
it := storage.Find(ctx, []byte{prefixRecord}, storage.DeserializeValues)
for iterator.Next(it) {
oldRec := iterator.Value(it).(struct {
key string
rec RecordState
})
newRec := RecordState{
Name: oldRec.rec.Name,
Type: oldRec.rec.Type,
Data: oldRec.rec.Data,
ID: 0,
}
newKey := append([]byte(oldRec.key), newRec.ID)
rec := std.Serialize(newRec)
storage.Put(ctx, newKey, rec)
storage.Delete(ctx, oldRec.key)
}

maxExpire := 1<<31 - 1
domains := storage.Find(ctx, []byte{prefixName}, storage.ValuesOnly|storage.DeserializeValues)
for iterator.Next(domains) {
ns := iterator.Value(domains).(NameState)
putSoaRecord(ctx, ns.Name, "[email protected]", 86400, 7200, maxExpire, 3600)
}

return
}
ctx := storage.GetContext()
Expand Down

0 comments on commit 621ce97

Please sign in to comment.