-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Code Health] chore: resolve & cleanup outstanding `TODO_TECHDEBT(#517)…
…` comments (#559) Co-authored-by: Daniel Olshansky <[email protected]>
- Loading branch information
1 parent
72d3e47
commit 862b793
Showing
20 changed files
with
150 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package session | ||
|
||
import ( | ||
"github.com/pokt-network/poktroll/x/session/keeper" | ||
"github.com/pokt-network/poktroll/x/shared" | ||
"github.com/pokt-network/poktroll/x/shared/types" | ||
) | ||
|
||
// GetSessionIdWithDefaultParams returns the string and bytes representation of the | ||
// sessionId for the session containing blockHeight, given the default shared on-chain | ||
// parameters, application public key, service ID, and block hash. | ||
func GetSessionIdWithDefaultParams( | ||
appPubKey, | ||
serviceId string, | ||
blockHashBz []byte, | ||
blockHeight int64, | ||
) (sessionId string, sessionIdBz []byte) { | ||
sharedParams := types.DefaultParams() | ||
return keeper.GetSessionId(&sharedParams, appPubKey, serviceId, blockHashBz, blockHeight) | ||
} | ||
|
||
// GetSessionStartHeightWithDefaultParams returns the block height at which the | ||
// session containing queryHeight starts, given the default shared on-chain | ||
// parameters. | ||
// See shared.GetSessionStartHeight for more details. | ||
func GetSessionStartHeightWithDefaultParams(queryHeight int64) int64 { | ||
sharedParams := types.DefaultParams() | ||
return shared.GetSessionStartHeight(&sharedParams, queryHeight) | ||
} | ||
|
||
// GetSessionEndHeightWithDefaultParams returns the block height at which the session | ||
// containing queryHeight ends, given the default shared on-chain parameters. | ||
// See shared.GetSessionEndHeight for more details. | ||
func GetSessionEndHeightWithDefaultParams(queryHeight int64) int64 { | ||
sharedParams := types.DefaultParams() | ||
return shared.GetSessionEndHeight(&sharedParams, queryHeight) | ||
} | ||
|
||
// GetSessionNumberWithDefaultParams returns the session number of the session | ||
// containing queryHeight, given the default on-chain shared parameters. | ||
// See shared.GetSessionNumber for more details. | ||
func GetSessionNumberWithDefaultParams(queryHeight int64) int64 { | ||
sharedParams := types.DefaultParams() | ||
return shared.GetSessionNumber(&sharedParams, queryHeight) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.