From 404fdc2691d1fc5732ede10d84fd1ec2a5ea0884 Mon Sep 17 00:00:00 2001 From: ccamel Date: Sat, 23 Nov 2024 18:52:23 +0100 Subject: [PATCH] feat(logic): deprecate the block_time/1 predicate --- x/logic/interpreter/registry.go | 2 +- x/logic/predicate/block.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/x/logic/interpreter/registry.go b/x/logic/interpreter/registry.go index 698a09bf..d55a0a14 100644 --- a/x/logic/interpreter/registry.go +++ b/x/logic/interpreter/registry.go @@ -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}, diff --git a/x/logic/predicate/block.go b/x/logic/predicate/block.go index e82092e0..08fd058e 100644 --- a/x/logic/predicate/block.go +++ b/x/logic/predicate/block.go @@ -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)