[#883] adm: Add domainOf function to resolve NNS domain
All checks were successful
Vulncheck / Vulncheck (pull_request) Successful in 2m49s
DCO action / DCO (pull_request) Successful in 2m38s
Build / Build Components (1.21) (pull_request) Successful in 3m51s
Build / Build Components (1.20) (pull_request) Successful in 3m59s
Tests and linters / Staticcheck (pull_request) Successful in 4m59s
Tests and linters / Lint (pull_request) Successful in 5m59s
Tests and linters / Tests (1.20) (pull_request) Successful in 8m45s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m47s
Tests and linters / Tests with -race (pull_request) Successful in 4m15s
All checks were successful
Vulncheck / Vulncheck (pull_request) Successful in 2m49s
DCO action / DCO (pull_request) Successful in 2m38s
Build / Build Components (1.21) (pull_request) Successful in 3m51s
Build / Build Components (1.20) (pull_request) Successful in 3m59s
Tests and linters / Staticcheck (pull_request) Successful in 4m59s
Tests and linters / Lint (pull_request) Successful in 5m59s
Tests and linters / Tests (1.20) (pull_request) Successful in 8m45s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m47s
Tests and linters / Tests with -race (pull_request) Successful in 4m15s
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
parent
ac0821a1a5
commit
b1eab1de54
10 changed files with 18 additions and 14 deletions
|
@ -91,6 +91,10 @@ const (
|
|||
deployMethodName = "deploy"
|
||||
)
|
||||
|
||||
func domainOf(contract string) string {
|
||||
return contract + ".frostfs"
|
||||
}
|
||||
|
||||
func (c *initializeContext) deployNNS(method string) error {
|
||||
cs := c.getContract(nnsContract)
|
||||
h := cs.Hash
|
||||
|
@ -198,7 +202,7 @@ func (c *initializeContext) deployOrUpdateContracts(w *io2.BufBinWriter, nnsHash
|
|||
cs := c.getContract(ctrName)
|
||||
|
||||
method := updateMethodName
|
||||
ctrHash, err := nnsResolveHash(c.ReadOnlyInvoker, nnsHash, ctrName+".frostfs")
|
||||
ctrHash, err := nnsResolveHash(c.ReadOnlyInvoker, nnsHash, domainOf(ctrName))
|
||||
if err != nil {
|
||||
if errors.Is(err, errMissingNNSRecord) {
|
||||
// if contract not found we deploy it instead of update
|
||||
|
@ -595,7 +599,7 @@ func (c *initializeContext) getNetConfigFromNetmapContract() ([]stackitem.Item,
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("NNS is not yet deployed: %w", err)
|
||||
}
|
||||
nmHash, err := nnsResolveHash(c.ReadOnlyInvoker, cs.Hash, netmapContract+".frostfs")
|
||||
nmHash, err := nnsResolveHash(c.ReadOnlyInvoker, cs.Hash, domainOf(netmapContract))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't get netmap contract hash: %w", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue