Skip to content

Conversation

@yashnevatia
Copy link
Contributor

@yashnevatia yashnevatia commented Nov 19, 2025

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

@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
72.5% Coverage on New Code (required ≥ 75%)

See analysis details on SonarQube

}

func (c *chain) SubmitTransaction(ctx context.Context, programConfig ChainProgramConfig, contractName, method string, args any, transactionID string, toAddress string) error {
contractConfig, exists := programConfig.Programs[contractName]
Copy link
Contributor

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)
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants