NethermindEth / starknet.go

Golang Library for StarkNet/Cairo
MIT License
145 stars 105 forks source link

chore::> Constrain BroadcastDeclare and BroadcastDeployAccount #585

Closed PsychoPunkSage closed 3 months ago

PsychoPunkSage commented 3 months ago

Here I implemented:

  1. GetContractClass ::> BroadcastDeclareTxnType interface
  2. GetConstructorCalldata and GetContractAddressSalt ::> BroadcastAddDeployTxnType interface

As these are the best distinguishing factors for objects that implements respective interfaces

PsychoPunkSage commented 3 months ago

I have a question... Shouldn't THIS PART be assigned to BroadcastDeclareTxnType instead of BroadcastAddDeployTxnType. Cause its a test for DeclareTransaction not AddDeployTxn...

rianhughes commented 3 months ago

Shouldn't THIS PART be assigned to BroadcastDeclareTxnType instead of BroadcastAddDeployTxnType.

Yes, you're correct, nice catch!

You'll also need to remove the switch-case logic in the AddDeclareTransaction method. After that you should be able to fix the tests (which will require updating mock_starknet_addDeclareTransaction (since this function is called in the mock tests))

PsychoPunkSage commented 3 months ago

Done, Updated everything, ready to be merged!!