-
Notifications
You must be signed in to change notification settings - Fork 58
use chain_writer_utils #1388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
use chain_writer_utils #1388
Conversation
|
| } | ||
|
|
||
| func (c *chain) SubmitTransaction(ctx context.Context, programConfig ChainProgramConfig, contractName, method string, args any, transactionID string, toAddress string) error { | ||
| contractConfig, exists := programConfig.Programs[contractName] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, what's the point of accepting a map with program configs and a contract name, just to resolve program config? Why not accept config as an argument
| } | ||
|
|
||
| // Parse programs and create codec with proper encoder definitions | ||
| _, encoder, err := chainwriterutils.ParseProgramsToCodec(programConfig.Programs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here, we call one endpoint here, so we need just one encoder?


core ref: pkg-chain-submitTx
I basically moved everything out of chain_writer that submitTx uses and put it into chain_writer_utils (we can rename this).
And then i just called the implementation of the SubmitTx function from both chain.go and chain_writer.go