Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Contextual task befor transaction

Đang mở
#628 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend-api-design

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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!
Ngôn ngữ chính
Java
Star
322
Fork
210
Merge trung bình
15 giờ 16 phút
Pull request đã merge (30 ngày)
29

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của hyperledger/fabric-chaincode-java

Tất cả issue của hyperledger/fabric-chaincode-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.