Closed envestcc closed 3 months ago
can you rebase this PR? i think lots of code has already checked in
As discussed offline, let's change the logic of creating delegate to:
if delegateByOwner(creator) != nil {
return duplicate error
}
id := creator
while delegateByIdentifier(id) != nil { // up to N = 1000 times
id = hash(id)
}
create delegate with id
such that an account who doesn't own a delegate could always create a delegate.
Make sure the scenario works in this PR.
Member
As discussed offline, let's change the logic of creating delegate to:
if delegateByOwner(creator) != nil { return duplicate error } id := creator while delegateByIdentifier(id) != nil { // up to N = 1000 times id = hash(id) } create delegate with id
such that an account who doesn't own a delegate could always create a delegate.
Make sure the scenario works in this PR.
agreed, discussed offline we can use logic similar to id = hash(address, blockheight)
Failed conditions
24.9% Duplication on New Code (required ≤ 3%)
Description
Due to the introduction of a new
ID
as a unique identifier by the Candidate, the following modifications need to be made to the API:candidateByAddress
,candidateByName
, andcandidates
APIs to v3, adding 'id' to the returned results.candidateByID
; the original meaning of thecandidateByAddress
is to query based on the owner's address.It's based on https://github.com/iotexproject/iotex-proto/pull/151
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: