Skip to content

Commit

Permalink
fix(gar): fix min stake validation on gar
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Jun 25, 2024
1 parent af71b50 commit 84c9d50
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,10 @@ function gar.assertValidGatewayParameters(from, stake, settings, observerAddress
"port is required and must be an integer between 0 and 65535"
)
assert(type(settings.properties) == "string", "properties is required and must be a string")
assert(
stake >= gar.getSettings().operators.minStake,
"Operator stake must be greater than the minimum stake to join the network"
)
if settings.delegateRewardShareRatio ~= nil then
assert(
type(settings.delegateRewardShareRatio) == "number"
Expand All @@ -514,7 +518,9 @@ function gar.assertValidGatewayParameters(from, stake, settings, observerAddress
end
if settings.minDelegatedStake ~= nil then
assert(
type(settings.minDelegatedStake) == "number" and utils.isInteger(settings.minDelegatedStake),
type(settings.minDelegatedStake) == "number"
and utils.isInteger(settings.minDelegatedStake)
and settings.minDelegatedStake >= gar.getSettings().delegates.minStake,
"minDelegatedStake must be an integer and "
)
end
Expand Down

0 comments on commit 84c9d50

Please sign in to comment.