forked from TrueCloudLab/frostfs-contract
[#184] *: Delete method prefix from runtime.Log()
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
2ee2344e5f
commit
27c97237cf
5 changed files with 22 additions and 22 deletions
|
@ -245,7 +245,7 @@ func Lock(txDetails []byte, from, to interop.Hash160, amount, until int) {
|
||||||
panic("can't lock funds")
|
panic("can't lock funds")
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.Log("lock: created lock account")
|
runtime.Log("created lock account")
|
||||||
runtime.Notify("Lock", txDetails, from, to, amount, until)
|
runtime.Notify("Lock", txDetails, from, to, amount, until)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ func Mint(to interop.Hash160, amount int, txDetails []byte) {
|
||||||
supply := token.getSupply(ctx)
|
supply := token.getSupply(ctx)
|
||||||
supply = supply + amount
|
supply = supply + amount
|
||||||
storage.Put(ctx, token.CirculationKey, supply)
|
storage.Put(ctx, token.CirculationKey, supply)
|
||||||
runtime.Log("mint: assets were minted")
|
runtime.Log("assets were minted")
|
||||||
runtime.Notify("Mint", to, amount)
|
runtime.Notify("Mint", to, amount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ func Burn(from interop.Hash160, amount int, txDetails []byte) {
|
||||||
|
|
||||||
supply = supply - amount
|
supply = supply - amount
|
||||||
storage.Put(ctx, token.CirculationKey, supply)
|
storage.Put(ctx, token.CirculationKey, supply)
|
||||||
runtime.Log("burn: assets were burned")
|
runtime.Log("assets were burned")
|
||||||
runtime.Notify("Burn", from, amount)
|
runtime.Notify("Burn", from, amount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@ func (t Token) canTransfer(ctx storage.Context, from, to interop.Hash160, amount
|
||||||
|
|
||||||
if !innerRing {
|
if !innerRing {
|
||||||
if len(to) != 20 || !isUsableAddress(from) {
|
if len(to) != 20 || !isUsableAddress(from) {
|
||||||
runtime.Log("transfer: bad script hashes")
|
runtime.Log("bad script hashes")
|
||||||
return emptyAcc, false
|
return emptyAcc, false
|
||||||
}
|
}
|
||||||
} else if len(from) == 0 {
|
} else if len(from) == 0 {
|
||||||
|
@ -474,7 +474,7 @@ func (t Token) canTransfer(ctx storage.Context, from, to interop.Hash160, amount
|
||||||
|
|
||||||
amountFrom := getAccount(ctx, from)
|
amountFrom := getAccount(ctx, from)
|
||||||
if amountFrom.Balance < amount {
|
if amountFrom.Balance < amount {
|
||||||
runtime.Log("transfer: not enough assets")
|
runtime.Log("not enough assets")
|
||||||
return emptyAcc, false
|
return emptyAcc, false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -267,7 +267,7 @@ func PutNamed(container []byte, signature interop.Signature,
|
||||||
contract.Call(neofsIDContractAddr, "addKey", contract.All, ownerID, [][]byte{publicKey})
|
contract.Call(neofsIDContractAddr, "addKey", contract.All, ownerID, [][]byte{publicKey})
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.Log("put: added new container")
|
runtime.Log("added new container")
|
||||||
}
|
}
|
||||||
|
|
||||||
// checkNiceNameAvailable checks if nice name is available for the container.
|
// checkNiceNameAvailable checks if nice name is available for the container.
|
||||||
|
@ -348,7 +348,7 @@ func Delete(containerID []byte, signature interop.Signature, token []byte) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
removeContainer(ctx, containerID, ownerID)
|
removeContainer(ctx, containerID, ownerID)
|
||||||
runtime.Log("delete: remove container")
|
runtime.Log("remove container")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get method returns structure that contains stable marshaled Container structure,
|
// Get method returns structure that contains stable marshaled Container structure,
|
||||||
|
@ -455,7 +455,7 @@ func SetEACL(eACL []byte, signature interop.Signature, publicKey interop.PublicK
|
||||||
|
|
||||||
common.SetSerialized(ctx, key, rule)
|
common.SetSerialized(ctx, key, rule)
|
||||||
|
|
||||||
runtime.Log("setEACL: success")
|
runtime.Log("success")
|
||||||
}
|
}
|
||||||
|
|
||||||
// EACL method returns structure that contains stable marshaled EACLTable structure,
|
// EACL method returns structure that contains stable marshaled EACLTable structure,
|
||||||
|
@ -501,7 +501,7 @@ func PutContainerSize(epoch int, cid []byte, usedSize int, pubKey interop.Public
|
||||||
|
|
||||||
storage.Put(ctx, key, std.Serialize(s))
|
storage.Put(ctx, key, std.Serialize(s))
|
||||||
|
|
||||||
runtime.Log("container: saved container size estimation")
|
runtime.Log("saved container size estimation")
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetContainerSize method returns container ID and slice of container
|
// GetContainerSize method returns container ID and slice of container
|
||||||
|
@ -616,7 +616,7 @@ func StartContainerEstimation(epoch int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.Notify("StartEstimation", epoch)
|
runtime.Notify("StartEstimation", epoch)
|
||||||
runtime.Log("startEstimation: notification has been produced")
|
runtime.Log("notification has been produced")
|
||||||
}
|
}
|
||||||
|
|
||||||
// StopContainerEstimation method produces StopEstimation notification.
|
// StopContainerEstimation method produces StopEstimation notification.
|
||||||
|
@ -654,7 +654,7 @@ func StopContainerEstimation(epoch int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.Notify("StopEstimation", epoch)
|
runtime.Notify("StopEstimation", epoch)
|
||||||
runtime.Log("stopEstimation: notification has been produced")
|
runtime.Log("notification has been produced")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Version returns version of the contract.
|
// Version returns version of the contract.
|
||||||
|
|
|
@ -178,7 +178,7 @@ func InnerRingCandidateRemove(key interop.PublicKey) {
|
||||||
if !common.BytesEqual(c.PublicKey, key) {
|
if !common.BytesEqual(c.PublicKey, key) {
|
||||||
nodes = append(nodes, c)
|
nodes = append(nodes, c)
|
||||||
} else {
|
} else {
|
||||||
runtime.Log("irCandidateRemove: candidate has been removed")
|
runtime.Log("candidate has been removed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ func InnerRingCandidateAdd(key interop.PublicKey) {
|
||||||
panic("failed to transfer funds, aborting")
|
panic("failed to transfer funds, aborting")
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.Log("irCandidateAdd: candidate has been added")
|
runtime.Log("candidate has been added")
|
||||||
common.SetSerialized(ctx, candidatesKey, list)
|
common.SetSerialized(ctx, candidatesKey, list)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) {
|
||||||
panic("invalid data argument, expected Hash160")
|
panic("invalid data argument, expected Hash160")
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.Log("onNEP17Payment: funds have been transferred")
|
runtime.Log("funds have been transferred")
|
||||||
|
|
||||||
tx := runtime.GetScriptContainer()
|
tx := runtime.GetScriptContainer()
|
||||||
runtime.Notify("Deposit", from, amount, rcv, tx.Hash)
|
runtime.Notify("Deposit", from, amount, rcv, tx.Hash)
|
||||||
|
@ -359,7 +359,7 @@ func Cheque(id []byte, user interop.Hash160, amount int, lockAcc []byte) {
|
||||||
panic("failed to transfer funds, aborting")
|
panic("failed to transfer funds, aborting")
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.Log("cheque: funds have been transferred")
|
runtime.Log("funds have been transferred")
|
||||||
runtime.Notify("Cheque", id, user, amount, lockAcc)
|
runtime.Notify("Cheque", id, user, amount, lockAcc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,7 +459,7 @@ func AlphabetUpdate(id []byte, args []interop.PublicKey) {
|
||||||
common.SetSerialized(ctx, alphabetKey, newAlphabet)
|
common.SetSerialized(ctx, alphabetKey, newAlphabet)
|
||||||
|
|
||||||
runtime.Notify("AlphabetUpdate", id, newAlphabet)
|
runtime.Notify("AlphabetUpdate", id, newAlphabet)
|
||||||
runtime.Log("alphabetUpdate: alphabet list has been updated")
|
runtime.Log("alphabet list has been updated")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config returns configuration value of NeoFS configuration. If key does
|
// Config returns configuration value of NeoFS configuration. If key does
|
||||||
|
@ -505,7 +505,7 @@ func SetConfig(id, key, val []byte) {
|
||||||
setConfig(ctx, key, val)
|
setConfig(ctx, key, val)
|
||||||
|
|
||||||
runtime.Notify("SetConfig", id, key, val)
|
runtime.Notify("SetConfig", id, key, val)
|
||||||
runtime.Log("setConfig: configuration has been updated")
|
runtime.Log("configuration has been updated")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListConfig returns array of structures that contain key and value of all
|
// ListConfig returns array of structures that contain key and value of all
|
||||||
|
|
|
@ -140,7 +140,7 @@ func AddKey(owner []byte, keys []interop.PublicKey) {
|
||||||
common.RemoveVotes(ctx, id)
|
common.RemoveVotes(ctx, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.Log("addKey: key bound to the owner")
|
runtime.Log("key bound to the owner")
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveKey unbinds provided public keys from OwnerID. Can be invoked only by
|
// RemoveKey unbinds provided public keys from OwnerID. Can be invoked only by
|
||||||
|
|
|
@ -183,7 +183,7 @@ func UpdateInnerRing(keys []interop.PublicKey) {
|
||||||
common.RemoveVotes(ctx, id)
|
common.RemoveVotes(ctx, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime.Log("updateInnerRing: inner ring list updated")
|
runtime.Log("inner ring list updated")
|
||||||
common.SetSerialized(ctx, innerRingKey, irList)
|
common.SetSerialized(ctx, innerRingKey, irList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ func UpdateState(state int, publicKey interop.PublicKey) {
|
||||||
switch nodeState(state) {
|
switch nodeState(state) {
|
||||||
case offlineState:
|
case offlineState:
|
||||||
removeFromNetmap(ctx, publicKey)
|
removeFromNetmap(ctx, publicKey)
|
||||||
runtime.Log("updateState: remove storage node from the network map")
|
runtime.Log("remove storage node from the network map")
|
||||||
default:
|
default:
|
||||||
panic("unsupported state")
|
panic("unsupported state")
|
||||||
}
|
}
|
||||||
|
@ -346,7 +346,7 @@ func NewEpoch(epochNum int) {
|
||||||
data0snapshot := getSnapshot(ctx, snapshot0Key)
|
data0snapshot := getSnapshot(ctx, snapshot0Key)
|
||||||
dataOnlineState := filterNetmap(ctx, onlineState)
|
dataOnlineState := filterNetmap(ctx, onlineState)
|
||||||
|
|
||||||
runtime.Log("newEpoch: process new epoch")
|
runtime.Log("process new epoch")
|
||||||
|
|
||||||
// todo: check if provided epoch number is bigger than current
|
// todo: check if provided epoch number is bigger than current
|
||||||
storage.Put(ctx, snapshotEpoch, epochNum)
|
storage.Put(ctx, snapshotEpoch, epochNum)
|
||||||
|
@ -469,7 +469,7 @@ func SetConfig(id, key, val []byte) {
|
||||||
|
|
||||||
setConfig(ctx, key, val)
|
setConfig(ctx, key, val)
|
||||||
|
|
||||||
runtime.Log("setConfig: configuration has been updated")
|
runtime.Log("configuration has been updated")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListConfig returns array of structures that contain key and value of all
|
// ListConfig returns array of structures that contain key and value of all
|
||||||
|
|
Loading…
Reference in a new issue