Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Contextual task befor transaction

Aberta
#628 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
java

Direção de pesquisa

Start by locating ContractInterface.beforeTransaction and SerializerInterface.toBuffer/fromBuffer, then inspect their implementations and tests. Trace how transaction parameters and Context are currently propagated; done means hooks and custom serializers can access the active Context and transaction inputs without ThreadLocal, with compatibility covered by tests.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

enhancement
Current Status

ContractInterface.beforeTransaction receives the active Context, but not the parameters passed to the transaction method. The SerializerInterface methods (toBuffer and fromBuffer) do not receive a Context.

This prevents hooks and custom serializers from directly accessing both the transaction context and its input data. For example, a custom serializer that needs to perform Jakarta Bean Validation during deserialization cannot access the current Context through the API. A workaround is to pass it through a ThreadLocal and a custom Context implementation, relying on the shim's current thread-per-request behavior.

Expected

Contract hooks and custom serializers should be able to access the active transaction Context. The hook should also be able to inspect the parameters intended for the transaction method.

This would allow developers to perform shared parameter validation, make context-dependent decisions, and implement context-aware serialization without relying on ThreadLocal.

Solution

Consider adding the transaction parameters to the hook:

default void beforeTransaction(final Context ctx, final Object... params)


### Please let us know if you plan to work on this.

Yes!
Linguagem predominante
Java
Estrelas
322
Forks
210
Merge médio
22h 13min
PRs com merge (30d)
17

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de hyperledger/fabric-chaincode-java

Todas as issues de hyperledger/fabric-chaincode-java

Issues semelhantes

Mais issues de Java

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.