Skip to content

Commit

Permalink
add authorizer staking (#1392)
Browse files Browse the repository at this point in the history
Co-authored-by: Yury <[email protected]>
  • Loading branch information
devyetii and dabasov authored Feb 15, 2024
1 parent c99d500 commit 0f583eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/transaction/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ const (
ZCNSC_AUTHORIZER_HEALTH_CHECK = "authorizer-health-check"
ZCNSC_DELETE_AUTHORIZER = "delete-authorizer"
ZCNSC_COLLECT_REWARD = "collect-rewards"
ZCNSC_LOCK = "add-to-delegate-pool"
ZCNSC_UNLOCK = "delete-from-delegate-pool"

ESTIMATE_TRANSACTION_COST = `/v1/estimate_txn_fee`
FEES_TABLE = `/v1/fees_table`
Expand Down
6 changes: 6 additions & 0 deletions zboxcore/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ func StakePoolLock(providerType ProviderType, providerID string, value, fee uint
case ProviderMiner, ProviderSharder:
scAddress = MINERSC_SCADDRESS
sn.Name = transaction.MINERSC_LOCK
case ProviderAuthorizer:
scAddress = ZCNSC_SCADDRESS
sn.Name = transaction.ZCNSC_LOCK
default:
return "", 0, errors.Newf("stake_pool_lock", "unsupported provider type: %v", providerType)
}
Expand Down Expand Up @@ -445,6 +448,9 @@ func StakePoolUnlock(providerType ProviderType, providerID string, fee uint64) (
case ProviderMiner, ProviderSharder:
scAddress = MINERSC_SCADDRESS
sn.Name = transaction.MINERSC_UNLOCK
case ProviderAuthorizer:
scAddress = ZCNSC_SCADDRESS
sn.Name = transaction.ZCNSC_UNLOCK
default:
return 0, 0, errors.Newf("stake_pool_unlock", "unsupported provider type: %v", providerType)
}
Expand Down

0 comments on commit 0f583eb

Please sign in to comment.