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
Attempting to call anchor programs that have rpcs which include a number in the handler name. Attempting to call these functions results in the fallback function error (Fallback functions are not supported. If you have a use case, please file an issue.)
For example using the following program you will be unable to call test_log_1 or test_log_2:
import*asanchorfrom'@project-serum/anchor';describe('margin',()=>{// Configure the client to use the local cluster.anchor.setProvider(anchor.Provider.env());// Add your test here.constprogram=anchor.workspace.Margin;it('Is initialized!',async()=>{consttx=awaitprogram.rpc.initialize();console.log("Your transaction signature",tx);});it("tests log 1",async()=>{awaitprogram.rpc.testLog1();})it("tests log 2",async()=>{awaitprogram.rpc.testLog2();})});
If you change the handler names to test_log_one and test_log_two everything works:
import*asanchorfrom'@project-serum/anchor';describe('margin',()=>{// Configure the client to use the local cluster.anchor.setProvider(anchor.Provider.env());// Add your test here.constprogram=anchor.workspace.Margin;it('Is initialized!',async()=>{consttx=awaitprogram.rpc.initialize();console.log("Your transaction signature",tx);});it("tests log 1",async()=>{awaitprogram.rpc.testLogOne();})it("tests log 2",async()=>{awaitprogram.rpc.testLogTwo();})});
Version
anchor-cli 0.5.0
The text was updated successfully, but these errors were encountered:
This issue occurs whenever a token containing a single case glyph after an underscore is converted to camel case.
Any name with an underscore preceding a number will be converted to the same camel case as with no underscore preceding the number, and therefore hashed as if no underscore preceded the number e.g. do_5_times -> do5Times -> do5_times
Overview
Attempting to call anchor programs that have rpcs which include a number in the handler name. Attempting to call these functions results in the fallback function error (
Fallback functions are not supported. If you have a use case, please file an issue.
)For example using the following program you will be unable to call
test_log_1
ortest_log_2
:Test code:
If you change the handler names to
test_log_one
andtest_log_two
everything works:test code
Version
anchor-cli 0.5.0
The text was updated successfully, but these errors were encountered: