Skip to content

Commit

Permalink
feat(logic): deprecate the block_time/1 predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Nov 23, 2024
1 parent 8a6144e commit 404fdc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x/logic/interpreter/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var registry = orderedmap.New[string, any](
{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},
{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 @@ -36,6 +36,8 @@ func BlockHeight(vm *engine.VM, height engine.Term, cont engine.Cont, env *engin
//
// where:
// - Time represents the current chain time at the time of the query.
//
// Deprecated: Use the `block_header/1` predicate instead.
func BlockTime(vm *engine.VM, time 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 404fdc2

Please sign in to comment.