Skip to content
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

Bugs/en 3228 sc processor refund gas #321

Merged
merged 12 commits into from
Jul 31, 2019

Conversation

iulianpascalau
Copy link
Contributor

Fixed bug when refunding gas to the tx sender when executing an intra-shard sc call tx and VM changed the balance of the sender
Added integration test

@iulianpascalau iulianpascalau changed the base branch from master to development July 30, 2019 10:38
@iulianpascalau iulianpascalau self-assigned this Jul 30, 2019
@iulianpascalau iulianpascalau added type:bug Something isn't working P1 labels Jul 30, 2019
@ccorcoveanu ccorcoveanu self-requested a review July 30, 2019 10:58
var agarioFile = "agarioV2.hex"
var stepDelay = time.Second

func TestShouldProcessBlocksWithScTxsJoinAndRewardTheOwner(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function too long

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reduced to 47 chars

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not the function name. but the number of the lines in the function

nodes []*integrationTests.TestProcessorNode,
idxNode int,
joinGameVal *big.Int,
scAddress []byte) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add enter after []byte

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

idxNodeOwner int,
idxNodeUser int,
prize *big.Int,
scAddress []byte) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add enter after []byte

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

syncBlock(t, nodes, idxProposer, round)
round = incrementAndPrintRound(round)

proposeBlock(nodes, idxProposer, round)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need to propose and sync again ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍, I was about to ask the same thing, maybe a comment would be needed here as an explanation

scAddress []byte) {

fmt.Println("Calling SC.rewardAndSendToWallet...")
txDeploy := createTxRewardAndSendToWallet(nodes[idxNodeOwner], nodes[idxNodeUser], prize, scAddress)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a deploy tx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, fixed also multishard/block

scAddress []byte) {

fmt.Println("Calling SC.joinGame...")
txDeploy := createTxJoinGame(nodes[idxNode], joinGameVal, scAddress)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a deploy tx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

…est initializer, small code reformatting, changed some variable names, removed one extra step (propose-sync) in singleshard/block executingMiniblocksSc
syncBlock(t, nodes, idxProposer, round)
round = incrementAndPrintRound(round)

proposeBlock(nodes, idxProposer, round)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍, I was about to ask the same thing, maybe a comment would be needed here as an explanation

process/smartContract/process.go Outdated Show resolved Hide resolved
@iulianpascalau iulianpascalau merged commit 431dc58 into development Jul 31, 2019
@iulianpascalau iulianpascalau deleted the bugs/EN-3228-sc-processor-refund-gas branch July 31, 2019 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants