[TrueCloudLab#3] neofsid: Rename contract to frostfsid

Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
Denis Kirillov 2023-01-11 10:33:14 +03:00 committed by fyrchik
parent 402c13a607
commit a21630c1d7
6 changed files with 33 additions and 33 deletions

View file

@ -14,7 +14,7 @@ all: sidechain mainnet
sidechain: alphabet morph nns sidechain: alphabet morph nns
alphabet_sc = alphabet alphabet_sc = alphabet
morph_sc = audit balance container neofsid netmap proxy reputation subnet morph_sc = audit balance container frostfsid netmap proxy reputation subnet
mainnet_sc = frostfs processing mainnet_sc = frostfs processing
nns_sc = nns nns_sc = nns

View file

@ -1,4 +1,4 @@
name: "NeoFS ID" name: "FrostFS ID"
safemethods: ["key", "version"] safemethods: ["key", "version"]
permissions: permissions:
- methods: ["update"] - methods: ["update"]

20
frostfsid/doc.go Normal file
View file

@ -0,0 +1,20 @@
/*
FrostFSID contract is a contract deployed in FrostFS sidechain.
FrostFSID contract is used to store connection between an OwnerID and its public keys.
OwnerID is a 25-byte N3 wallet address that can be produced from a public key.
It is one-way conversion. In simple cases, FrostFS verifies ownership by checking
signature and relation between a public key and an OwnerID.
In more complex cases, a user can use public keys unrelated to the OwnerID to maintain
secure access to the data. FrostFSID contract stores relation between an OwnerID and
arbitrary public keys. Data owner can bind a public key with its account or unbind it
by invoking Bind or Unbind methods of FrostFS contract in the mainchain. After that,
Alphabet nodes produce multisigned AddKey and RemoveKey invocations of FrostFSID
contract.
# Contract notifications
FrostFSID contract does not produce notifications to process.
*/
package frostfsid

View file

@ -1,4 +1,4 @@
package neofsid package frostfsid
import ( import (
"github.com/TrueCloudLab/frostfs-contract/common" "github.com/TrueCloudLab/frostfs-contract/common"
@ -54,10 +54,10 @@ func _deploy(data interface{}, isUpdate bool) {
storage.Put(ctx, notaryDisabledKey, args.notaryDisabled) storage.Put(ctx, notaryDisabledKey, args.notaryDisabled)
if args.notaryDisabled { if args.notaryDisabled {
common.InitVote(ctx) common.InitVote(ctx)
runtime.Log("neofsid contract notary disabled") runtime.Log("frostfsid contract notary disabled")
} }
runtime.Log("neofsid contract initialized") runtime.Log("frostfsid contract initialized")
} }
// Update method updates contract source code and manifest. It can be invoked // Update method updates contract source code and manifest. It can be invoked
@ -69,7 +69,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
contract.Call(interop.Hash160(management.Hash), "update", contract.Call(interop.Hash160(management.Hash), "update",
contract.All, script, manifest, common.AppendVersion(data)) contract.All, script, manifest, common.AppendVersion(data))
runtime.Log("neofsid contract updated") runtime.Log("frostfsid contract updated")
} }
// AddKey binds a list of the provided public keys to the OwnerID. It can be invoked only by // AddKey binds a list of the provided public keys to the OwnerID. It can be invoked only by

View file

@ -1,20 +0,0 @@
/*
NeoFSID contract is a contract deployed in NeoFS sidechain.
NeoFSID contract is used to store connection between an OwnerID and its public keys.
OwnerID is a 25-byte N3 wallet address that can be produced from a public key.
It is one-way conversion. In simple cases, NeoFS verifies ownership by checking
signature and relation between a public key and an OwnerID.
In more complex cases, a user can use public keys unrelated to the OwnerID to maintain
secure access to the data. NeoFSID contract stores relation between an OwnerID and
arbitrary public keys. Data owner can bind a public key with its account or unbind it
by invoking Bind or Unbind methods of NeoFS contract in the mainchain. After that,
Alphabet nodes produce multisigned AddKey and RemoveKey invocations of NeoFSID
contract.
# Contract notifications
NeoFSID contract does not produce notifications to process.
*/
package neofsid

View file

@ -16,20 +16,20 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
const neofsidPath = "../neofsid" const frostfsidPath = "../frostfsid"
func deployNeoFSIDContract(t *testing.T, e *neotest.Executor, addrNetmap, addrContainer util.Uint160) util.Uint160 { func deployFrostFSIDContract(t *testing.T, e *neotest.Executor, addrNetmap, addrContainer util.Uint160) util.Uint160 {
args := make([]interface{}, 5) args := make([]interface{}, 5)
args[0] = false args[0] = false
args[1] = addrNetmap args[1] = addrNetmap
args[2] = addrContainer args[2] = addrContainer
c := neotest.CompileFile(t, e.CommitteeHash, neofsidPath, path.Join(neofsidPath, "config.yml")) c := neotest.CompileFile(t, e.CommitteeHash, frostfsidPath, path.Join(frostfsidPath, "config.yml"))
e.DeployContract(t, c, args) e.DeployContract(t, c, args)
return c.Hash return c.Hash
} }
func newNeoFSIDInvoker(t *testing.T) *neotest.ContractInvoker { func newFrostFSIDInvoker(t *testing.T) *neotest.ContractInvoker {
e := newExecutor(t) e := newExecutor(t)
ctrNNS := neotest.CompileFile(t, e.CommitteeHash, nnsPath, path.Join(nnsPath, "config.yml")) ctrNNS := neotest.CompileFile(t, e.CommitteeHash, nnsPath, path.Join(nnsPath, "config.yml"))
@ -43,12 +43,12 @@ func newNeoFSIDInvoker(t *testing.T) *neotest.ContractInvoker {
container.AliasFeeKey, int64(containerAliasFee)) container.AliasFeeKey, int64(containerAliasFee))
deployBalanceContract(t, e, ctrNetmap.Hash, ctrContainer.Hash) deployBalanceContract(t, e, ctrNetmap.Hash, ctrContainer.Hash)
deployContainerContract(t, e, ctrNetmap.Hash, ctrBalance.Hash, ctrNNS.Hash) deployContainerContract(t, e, ctrNetmap.Hash, ctrBalance.Hash, ctrNNS.Hash)
h := deployNeoFSIDContract(t, e, ctrNetmap.Hash, ctrContainer.Hash) h := deployFrostFSIDContract(t, e, ctrNetmap.Hash, ctrContainer.Hash)
return e.CommitteeInvoker(h) return e.CommitteeInvoker(h)
} }
func TestNeoFSID_AddKey(t *testing.T) { func TestFrostFSID_AddKey(t *testing.T) {
e := newNeoFSIDInvoker(t) e := newFrostFSIDInvoker(t)
pubs := make([][]byte, 6) pubs := make([][]byte, 6)
for i := range pubs { for i := range pubs {