diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f4f57..779db05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog Changelog for FrostFS Contract + ## [Unreleased] ### Added @@ -9,6 +10,21 @@ Changelog for FrostFS Contract ### Updated ### Fixed +## [0.21.0] + +### Added +- Mention domain name in error messages in the nns contract (#92) +- Emit DeleteRecord event on record deletion in the nns contract (#114) + +### Changed +- Allow to register TLD automatically (#114) +- Use frostfsid claims as a permission to create TLD (#115) +- Ensure subject keys are unique (#118, #129) + +### Fixed +- Terminate session in `ReadIteratorItems()` (#85) +- Declare `nns.getAllRecords` as safe (#131) + ## [0.20.0] ### Added diff --git a/VERSION b/VERSION index 1847373..759e855 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.20.0 +v0.21.0 diff --git a/common/version.go b/common/version.go index b177416..d599646 100644 --- a/common/version.go +++ b/common/version.go @@ -4,15 +4,15 @@ import "github.com/nspcc-dev/neo-go/pkg/interop/native/std" const ( major = 0 - minor = 20 + minor = 21 patch = 0 // 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 // any migration routines. prevMajor = 0 - prevMinor = 19 - prevPatch = 3 + prevMinor = 20 + prevPatch = 0 Version = major*1_000_000 + minor*1_000 + patch diff --git a/container/config.yml b/container/config.yml index c040d12..9778ed3 100644 --- a/container/config.yml +++ b/container/config.yml @@ -29,7 +29,7 @@ events: - name: DeleteSuccess parameters: - name: containerID - type: ByteArray + type: Hash256 - name: SetEACLSuccess parameters: - name: containerID diff --git a/container/container_contract.go b/container/container_contract.go index 7946923..c6b0420 100644 --- a/container/container_contract.go +++ b/container/container_contract.go @@ -279,7 +279,7 @@ func checkNiceNameAvailable(nnsContractAddr interop.Hash160, domain string) bool // API. // // If the container doesn't exist, it panics with NotFoundError. -func Delete(containerID []byte, signature interop.Signature, publicKey interop.PublicKey, token []byte) { +func Delete(containerID interop.Hash256, signature interop.Signature, publicKey interop.PublicKey, token []byte) { ctx := storage.GetContext() ownerID := getOwnerByID(ctx, containerID) diff --git a/rpcclient/container/client.go b/rpcclient/container/client.go index 4780ca5..216a912 100644 --- a/rpcclient/container/client.go +++ b/rpcclient/container/client.go @@ -25,7 +25,7 @@ type PutSuccessEvent struct { // DeleteSuccessEvent represents "DeleteSuccess" event emitted by the contract. type DeleteSuccessEvent struct { - ContainerID []byte + ContainerID util.Uint256 } // SetEACLSuccessEvent represents "SetEACLSuccess" event emitted by the contract. @@ -163,14 +163,14 @@ func (c *ContractReader) Version() (*big.Int, error) { // Delete creates a transaction invoking `delete` method of the contract. // This transaction is signed and immediately sent to the network. // The values returned are its hash, ValidUntilBlock value and error if any. -func (c *Contract) Delete(containerID []byte, signature []byte, publicKey *keys.PublicKey, token []byte) (util.Uint256, uint32, error) { +func (c *Contract) Delete(containerID util.Uint256, signature []byte, publicKey *keys.PublicKey, token []byte) (util.Uint256, uint32, error) { return c.actor.SendCall(c.hash, "delete", containerID, signature, publicKey, token) } // DeleteTransaction creates a transaction invoking `delete` method of the contract. // This transaction is signed, but not sent to the network, instead it's // returned to the caller. -func (c *Contract) DeleteTransaction(containerID []byte, signature []byte, publicKey *keys.PublicKey, token []byte) (*transaction.Transaction, error) { +func (c *Contract) DeleteTransaction(containerID util.Uint256, signature []byte, publicKey *keys.PublicKey, token []byte) (*transaction.Transaction, error) { return c.actor.MakeCall(c.hash, "delete", containerID, signature, publicKey, token) } @@ -178,7 +178,7 @@ func (c *Contract) DeleteTransaction(containerID []byte, signature []byte, publi // This transaction is not signed, it's simply returned to the caller. // Any fields of it that do not affect fees can be changed (ValidUntilBlock, // Nonce), fee values (NetworkFee, SystemFee) can be increased as well. -func (c *Contract) DeleteUnsigned(containerID []byte, signature []byte, publicKey *keys.PublicKey, token []byte) (*transaction.Transaction, error) { +func (c *Contract) DeleteUnsigned(containerID util.Uint256, signature []byte, publicKey *keys.PublicKey, token []byte) (*transaction.Transaction, error) { return c.actor.MakeUnsignedCall(c.hash, "delete", nil, containerID, signature, publicKey, token) } @@ -480,7 +480,17 @@ func (e *DeleteSuccessEvent) FromStackItem(item *stackitem.Array) error { err error ) index++ - e.ContainerID, err = arr[index].TryBytes() + e.ContainerID, err = func(item stackitem.Item) (util.Uint256, error) { + b, err := item.TryBytes() + if err != nil { + return util.Uint256{}, err + } + u, err := util.Uint256DecodeBytesBE(b) + if err != nil { + return util.Uint256{}, err + } + return u, nil + }(arr[index]) if err != nil { return fmt.Errorf("field ContainerID: %w", err) }