forked from TrueCloudLab/frostfs-node
[#732] neofs-adm: read alphabet contract once
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
8e71773c4a
commit
a2f6e07b1d
1 changed files with 7 additions and 7 deletions
|
@ -119,16 +119,16 @@ func (c *initializeContext) deployContracts() error {
|
||||||
cs.Hash = state.CreateContractHash(sender, cs.NEF.Checksum, cs.Manifest.Name)
|
cs.Hash = state.CreateContractHash(sender, cs.NEF.Checksum, cs.Manifest.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alphaCs, err := c.readContract(alphabetContract)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
var keysParam []smartcontract.Parameter
|
var keysParam []smartcontract.Parameter
|
||||||
|
|
||||||
// alphabet contracts should be deployed by individual nodes to get different hashes.
|
// alphabet contracts should be deployed by individual nodes to get different hashes.
|
||||||
for i, acc := range c.Accounts {
|
for i, acc := range c.Accounts {
|
||||||
cs, err := c.readContract(alphabetContract)
|
ctrHash := state.CreateContractHash(acc.Contract.ScriptHash(), alphaCs.NEF.Checksum, alphaCs.Manifest.Name)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
ctrHash := state.CreateContractHash(acc.Contract.ScriptHash(), cs.NEF.Checksum, cs.Manifest.Name)
|
|
||||||
if _, err := c.Client.GetContractStateByHash(ctrHash); err == nil {
|
if _, err := c.Client.GetContractStateByHash(ctrHash); err == nil {
|
||||||
c.Command.Printf("Stage 4: alphabet contract #%d is already deployed.\n", i)
|
c.Command.Printf("Stage 4: alphabet contract #%d is already deployed.\n", i)
|
||||||
continue
|
continue
|
||||||
|
@ -139,7 +139,7 @@ func (c *initializeContext) deployContracts() error {
|
||||||
Value: acc.PrivateKey().PublicKey().Bytes(),
|
Value: acc.PrivateKey().PublicKey().Bytes(),
|
||||||
})
|
})
|
||||||
|
|
||||||
params := getContractDeployParameters(cs.RawNEF, cs.RawManifest,
|
params := getContractDeployParameters(alphaCs.RawNEF, alphaCs.RawManifest,
|
||||||
c.getAlphabetDeployParameters(i, len(c.Wallets)))
|
c.getAlphabetDeployParameters(i, len(c.Wallets)))
|
||||||
signer := transaction.Signer{
|
signer := transaction.Signer{
|
||||||
Account: acc.Contract.ScriptHash(),
|
Account: acc.Contract.ScriptHash(),
|
||||||
|
|
Loading…
Reference in a new issue