Skip to content

Commit

Permalink
feat(logic): deprecate the block_height/1 predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Nov 23, 2024
1 parent 404fdc2 commit 0467fb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/logic/interpreter/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ var registry = orderedmap.New[string, any](
{Key: "call_nth/2", Value: engine.CallNth},
{Key: "./3", Value: engine.Op3},
{Key: "block_header/1", Value: predicate.BlockHeader},
{Key: "chain_id/1", Value: predicate.ChainID}, //nolint:staticcheck // Deprecated but still exposed for compatibility.
{Key: "block_height/1", Value: predicate.BlockHeight},
{Key: "block_time/1", Value: predicate.BlockTime}, //nolint:staticcheck // Deprecated but still exposed for compatibility.
{Key: "chain_id/1", Value: predicate.ChainID}, //nolint:staticcheck // Deprecated but still exposed for compatibility.
{Key: "block_height/1", Value: predicate.BlockHeight}, //nolint:staticcheck // Deprecated but still exposed for compatibility.
{Key: "block_time/1", Value: predicate.BlockTime}, //nolint:staticcheck // Deprecated but still exposed for compatibility.
{Key: "bank_balances/2", Value: predicate.BankBalances},
{Key: "bank_spendable_balances/2", Value: predicate.BankSpendableBalances},
{Key: "bank_locked_balances/2", Value: predicate.BankLockedBalances},
Expand Down
2 changes: 2 additions & 0 deletions x/logic/predicate/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
// where:
//
// - Height represents the current chain height at the time of the query.
//
// Deprecated: Use the `block_header/1` predicate instead.
func BlockHeight(vm *engine.VM, height engine.Term, cont engine.Cont, env *engine.Env) *engine.Promise {
return engine.Delay(func(ctx context.Context) *engine.Promise {
sdkContext, err := prolog.UnwrapSDKContext(ctx, env)
Expand Down

0 comments on commit 0467fb5

Please sign in to comment.