[#25] container: Use interop.Hash160
for contract addresses
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
2ef8c55562
commit
44cb7ccfd8
1 changed files with 3 additions and 3 deletions
|
@ -112,8 +112,8 @@ func Put(container []byte, signature interop.Signature, publicKey interop.Public
|
||||||
}
|
}
|
||||||
|
|
||||||
from := walletToScriptHash(ownerID)
|
from := walletToScriptHash(ownerID)
|
||||||
netmapContractAddr := storage.Get(ctx, netmapContractKey).([]byte)
|
netmapContractAddr := storage.Get(ctx, netmapContractKey).(interop.Hash160)
|
||||||
balanceContractAddr := storage.Get(ctx, balanceContractKey).([]byte)
|
balanceContractAddr := storage.Get(ctx, balanceContractKey).(interop.Hash160)
|
||||||
containerFee := contract.Call(netmapContractAddr, "config", contract.ReadOnly, containerFeeKey).(int)
|
containerFee := contract.Call(netmapContractAddr, "config", contract.ReadOnly, containerFeeKey).(int)
|
||||||
|
|
||||||
// todo: check if new container with unique container id
|
// todo: check if new container with unique container id
|
||||||
|
@ -154,7 +154,7 @@ func Delete(containerID, signature []byte) bool {
|
||||||
multiaddr := common.InnerRingMultiAddressViaStorage(ctx, netmapContractKey)
|
multiaddr := common.InnerRingMultiAddressViaStorage(ctx, netmapContractKey)
|
||||||
if !runtime.CheckWitness(multiaddr) {
|
if !runtime.CheckWitness(multiaddr) {
|
||||||
// check provided key
|
// check provided key
|
||||||
neofsIDContractAddr := storage.Get(ctx, neofsIDContractKey).([]byte)
|
neofsIDContractAddr := storage.Get(ctx, neofsIDContractKey).(interop.Hash160)
|
||||||
keys := contract.Call(neofsIDContractAddr, "key", contract.ReadOnly, ownerID).([]interop.PublicKey)
|
keys := contract.Call(neofsIDContractAddr, "key", contract.ReadOnly, ownerID).([]interop.PublicKey)
|
||||||
|
|
||||||
if !verifySignature(containerID, signature, keys) {
|
if !verifySignature(containerID, signature, keys) {
|
||||||
|
|
Loading…
Reference in a new issue