You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gravitonPR #21 aims to give confidence that PyTeal's soon-to-be relased ABI-Router works as expected. That work revealed that the ABI-Router's generated TEAL code, does not assert that exactly the number of arguments expected to be passed into an ABI-method call, are actually passed. A discussion around this issue resulted in a consensus around what actions to take. It was decided that since the vast majority of PyTEAL users are likely to use an Algorand supported SDK for interacting with the associated smart contract, it is sufficient that the client code assert this condition.
After further investigation, it appears that all 4 SDK's do indeed ensure that the number of arguments passed in a method call during execution, are the number that are defined in accordance to the method's specification.
However, the PROBLEM is that this is not officially tested for via Cucumber.
Solution
Introduce a new scenario with new steps that make this assertion.
Medium - as we want to have maximum confidence at the time of PyTEAL's ABI-Router release that the process of creating and using associated smart contract is as least error prone as possible.
Background / Notes for SDK Developers
Upshot Universal Error Message Regex
incorrect number of arguments|incorrect method arg number|incorrect number of method arguments|number of method arguments do not match the method signature
↠ (excepting java) number.*arguments
Summary of all Error Messages:
go
the incorrect number of arguments were provided …
java
Method call error: incorrect method arg number provided
javascript
Incorrect number of method arguments. Expected …
python
number of method arguments do not match the method signature
if (method.args.size() != methodArgs.size())
thrownewIllegalArgumentException("Method call error: incorrect method arg number provided");
JavaScript
“Incorrect number of method arguments. Expected ${method.args.length}, got ${methodArgs.length}”
export class AtomicTransactionComposer::addMethodCall(): src/composer.ts
if(methodArgs.length!==method.args.length){thrownewError(`Incorrect number of method arguments. Expected ${method.args.length}, got ${methodArgs.length}`);}
python
“number of method arguments do not match the method signature”
Problem (As of June 14, 2022)
graviton PR #21 aims to give confidence that PyTeal's soon-to-be relased ABI-Router works as expected. That work revealed that the ABI-Router's generated TEAL code, does not assert that exactly the number of arguments expected to be passed into an ABI-method call, are actually passed. A discussion around this issue resulted in a consensus around what actions to take. It was decided that since the vast majority of PyTEAL users are likely to use an Algorand supported SDK for interacting with the associated smart contract, it is sufficient that the client code assert this condition.
After further investigation, it appears that all 4 SDK's do indeed ensure that the number of arguments passed in a method call during execution, are the number that are defined in accordance to the method's specification.
However, the PROBLEM is that this is not officially tested for via Cucumber.
Solution
Introduce a new scenario with new steps that make this assertion.
Example Implementation
Python SDK PR #347 is one such example.
Dependencies
None
Urgency
Medium - as we want to have maximum confidence at the time of PyTEAL's ABI-Router release that the process of creating and using associated smart contract is as least error prone as possible.
Background / Notes for SDK Developers
Upshot Universal Error Message Regex
incorrect number of arguments|incorrect method arg number|incorrect number of method arguments|number of method arguments do not match the method signature
↠ (excepting java)
number.*arguments
Summary of all Error Messages:
go
“the incorrect number of arguments were provided”
func (atc *AtomicTransactionComposer) AddMethodCall(params AddMethodCallParams) error
future/atomicTransactionComposer.go
Java
“Method call error: incorrect method arg number provided”
class MethodCallParams::MethodCallParams()
src/main/java/com/algorand/algosdk/transaction/MethodCallParams.java
JavaScript
“Incorrect number of method arguments. Expected ${method.args.length}, got ${methodArgs.length}”
export class AtomicTransactionComposer::addMethodCall()
:src/composer.ts
python
“number of method arguments do not match the method signature”
class AtomicTransactionComposer::add_method_call()
algosdk/atomic_transaction_composer.py
The text was updated successfully, but these errors were encountered: