Open KimSeogyu opened 3 weeks ago
I'm fairly new to Go, could you give me the reason why?
I'm fairly new to Go, could you give me the reason why?
I'm a backend developer working with the aptos-go-sdk. I often apply mock implementations to completely separate the business logic from the blockchain during unit testing. The problem with the current approach of exporting clients as structs rather than interfaces is that the user has to manually implement an interface that mirrors all the methods of the aptos-go-sdk structure, which is required to insert either the actual aptos-go-sdk structure or a mock implementation. To simplify this process, we believe it is more efficient to export the client as an interface rather than a struct.
I'm fairly new to Go, could you give me the reason why?
I'm a backend developer working with the aptos-go-sdk. I often apply mock implementations to completely separate the business logic from the blockchain during unit testing. The problem with the current approach of exporting clients as structs rather than interfaces is that the user has to manually implement an interface that mirrors all the methods of the aptos-go-sdk structure, which is required to insert either the actual aptos-go-sdk structure or a mock implementation. To simplify this process, we believe it is more efficient to export the client as an interface rather than a struct.
Seems valid. Feel free to put up a pull request, or I will get to it eventually.
🚀 Feature Request Description
I suggest export Client, NodeClient (and more..) as a interface, not as a struct.