algorand / algorand/pyteal

Router testing with graviton - RouterSimulation doesn't handle overloaded method names

Đang mở
#662 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
new-feature-request Team Scytale
Ngôn ngữ chính
Python
Star
288
Fork
138
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Problem

Class `tests.blackbox.RouterSimulation` doesn't handle overloaded method names. In particular, consider [this example](https://github.com/algorand/pyteal/blob/89abe752b55355a337a4cbd40f64f72f0a0ea267/tests/integration/abi_router_test.py#L53); if another method in the router had the abi-signature `add(uint64,uint64)void` then `RouterSimulation` would act non-deterministically.

## Solution

[CallPredicates type](https://github.com/algorand/pyteal/blob/ac8ad40f04e10ef1aea8042bae6de2710326fa98/tests/blackbox.py#L73) should be keyed off method _signature_ as opposed to current method name. This will involve refactoring a few dependencies.

## Dependencies

None

## Urgency

Low - for the purposes of PyTeal itself, it is easy to work around the issue by not over-loading method names. However, if there is sufficient community interest in re-using `RouterSimulation` for smart contract testing, then it ought to be improved in the way described.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

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.