Skip to content

Commit

Permalink
Handle StakeGrant deny_list instead of allow_list
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon committed Nov 2, 2022
1 parent e311d25 commit e59c328
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 e59c328

Please sign in to comment.