[#118] *: Encode semver in version number

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
enable-notary-in-public-chains
Alex Vanin 2021-07-29 14:44:53 +03:00 committed by Alex Vanin
parent a10f470311
commit 8bd25230fa
11 changed files with 19 additions and 29 deletions

View File

@ -21,8 +21,6 @@ const (
nameKey = "name"
notaryDisabledKey = "notary"
version = 1
)
// OnNEP17Payment is a callback for NEP-17 compatible native GAS and NEO
@ -270,5 +268,5 @@ func Name() string {
// Version returns version of the contract.
func Version() int {
return version
return common.Version
}

View File

@ -36,8 +36,6 @@ func (a auditHeader) ID() []byte {
}
const (
version = 1
netmapContractKey = "netmapScriptHash"
notaryDisabledKey = "notary"
@ -212,7 +210,7 @@ loop:
// Version returns version of the contract.
func Version() int {
return version
return common.Version
}
// readNext reads length from first byte and then reads data (max 127 bytes).

View File

@ -38,7 +38,6 @@ const (
symbol = "NEOFS"
decimals = 12
circulation = "MainnetGAS"
version = 1
netmapContractKey = "netmapScriptHash"
containerContractKey = "containerScriptHash"
@ -431,7 +430,7 @@ func Burn(from interop.Hash160, amount int, txDetails []byte) {
// Version returns version of the contract.
func Version() int {
return version
return common.Version
}
// getSupply gets the token totalSupply value from VM storage.

View File

@ -0,0 +1,9 @@
package common
const (
major = 0
minor = 10
patch = 1
Version = major*1_000_000 + minor*1_000 + patch
)

View File

@ -43,8 +43,6 @@ type (
)
const (
version = 1
neofsIDContractKey = "identityScriptHash"
balanceContractKey = "balanceScriptHash"
netmapContractKey = "netmapScriptHash"
@ -556,7 +554,7 @@ func StopContainerEstimation(epoch int) {
// Version returns version of the contract.
func Version() int {
return version
return common.Version
}
func addContainer(ctx storage.Context, id, owner []byte, container Container) {

View File

@ -24,8 +24,6 @@ const (
candidateFeeConfigKey = "InnerRingCandidateFee"
withdrawFeeConfigKey = "WithdrawFee"
version = 3
alphabetKey = "alphabet"
candidatesKey = "candidates"
notaryDisabledKey = "notary"
@ -560,7 +558,7 @@ func InitConfig(args [][]byte) {
// Version returns version of the contract.
func Version() int {
return version
return common.Version
}
// getNodes returns deserialized slice of nodes from storage.

View File

@ -18,8 +18,6 @@ type (
)
const (
version = 1
netmapContractKey = "netmapScriptHash"
containerContractKey = "containerScriptHash"
notaryDisabledKey = "notary"
@ -235,7 +233,7 @@ func Key(owner []byte) [][]byte {
// Version returns version of the contract.
func Version() int {
return version
return common.Version
}
func getUserInfo(ctx storage.Context, key interface{}) UserInfo {

View File

@ -32,8 +32,6 @@ type (
)
const (
version = 1
configuredKey = "initconfig"
notaryDisabledKey = "notary"
innerRingKey = "innerring"
@ -534,7 +532,7 @@ func ListConfig() []record {
// Version returns version of the contract.
func Version() int {
return version
return common.Version
}
func addToNetmap(ctx storage.Context, n storageNode) {

View File

@ -11,8 +11,6 @@ import (
)
const (
version = 1
neofsContractKey = "neofsScriptHash"
multiaddrMethod = "alphabetAddress"
@ -79,5 +77,5 @@ func Verify() bool {
// Version returns version of the contract.
func Version() int {
return version
return common.Version
}

View File

@ -12,8 +12,6 @@ import (
)
const (
version = 1
netmapContractKey = "netmapScriptHash"
)
@ -82,5 +80,5 @@ func Verify() bool {
// Version returns version of the contract.
func Version() int {
return version
return common.Version
}

View File

@ -13,8 +13,6 @@ import (
const (
notaryDisabledKey = "notary"
version = 1
)
func _deploy(data interface{}, isUpdate bool) {
@ -162,7 +160,7 @@ loop:
// Version returns version of the contract.
func Version() int {
return version
return common.Version
}
func storageID(epoch int, peerID []byte) []byte {