Skip to content

Commit

Permalink
reputation: remove unused !alpha handler from reputation.Put
Browse files Browse the repository at this point in the history
In notary-enabled mode it's never called without a complete alphabet
signature, so this branch never happens. Even if it is to happen,
notary-enabled IR will ignore the event.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
  • Loading branch information
roman-khimov committed May 3, 2023
1 parent e835f56 commit 47cc247
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
8 changes: 0 additions & 8 deletions reputation/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,3 @@ safemethods: ["get", "getByID", "listByEpoch"]
permissions:
- methods: ["update"]
events:
- name: reputationPut
parameters:
- name: epoch
type: Integer
- name: peerID
type: ByteArray
- name: value
type: ByteArray
9 changes: 2 additions & 7 deletions reputation/reputation_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func Update(script []byte, manifest []byte, data interface{}) {
}

// Put method saves DataAuditResult in contract storage. It can be invoked only by
// Inner Ring nodes. It does not require multisignature invocations.
// storage nodes with Alphabet assistance (multisignature witness).
//
// Epoch is the epoch number when DataAuditResult structure was generated.
// PeerID contains public keys of the Inner Ring node that has produced DataAuditResult.
Expand All @@ -94,12 +94,7 @@ func Put(epoch int, peerID []byte, value []byte) {
ctx := storage.GetContext()

multiaddr := common.AlphabetAddress()
alphabetCall := runtime.CheckWitness(multiaddr)

if !alphabetCall {
runtime.Notify("reputationPut", epoch, peerID, value)
return
}
common.CheckAlphabetWitness(multiaddr)

id := storageID(epoch, peerID)

Expand Down

0 comments on commit 47cc247

Please sign in to comment.