Skip to content

Commit

Permalink
Merge pull request eco-stake#667 from eco-stake/autostake-handle-stak…
Browse files Browse the repository at this point in the history
…e-grant-deny-list

Autostake: Handle StakeGrant deny_list instead of allow_list
  • Loading branch information
tombeynon authored Nov 3, 2022
2 parents e311d25 + e59c328 commit 5c93b42
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/autostake/NetworkRunner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@ export default class NetworkRunner {
timeStamp(delegatorAddress, "Using GenericAuthorization, allowed")
grantValidators = [validatorAddress];
} else {
grantValidators = result.stakeGrant.authorization.allow_list.address
const { allow_list, deny_list } = result.stakeGrant.authorization
if(allow_list?.address){
grantValidators = allow_list?.address || []
}else if(deny_list?.address){
grantValidators = deny_list.address.includes(validatorAddress) ? [] : [validatorAddress]
}else{
grantValidators = []
}
if (!grantValidators.includes(validatorAddress)) {
timeStamp(delegatorAddress, "Not autostaking for this validator, skipping")
return
Expand Down

0 comments on commit 5c93b42

Please sign in to comment.