Skip to content

Commit

Permalink
convert dryrun cost field to int from uint
Browse files Browse the repository at this point in the history
  • Loading branch information
algoidurovic committed May 5, 2022
1 parent 704e0b4 commit e5aa557
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion daemon/algod/api/server/v2/dryrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ func doDryrunRequest(dr *DryrunRequest, response *generated.DryrunResponse) {
err = fmt.Errorf("cost budget exceeded: budget is %d but program cost was %d", allowedBudget-cumulativeCost, cost)
}
}
cost64 := uint64(cost)
cost64 := int64(cost)
result.Cost = &cost64
maxCurrentBudget = pooledAppBudget
cumulativeCost += cost
Expand Down
4 changes: 2 additions & 2 deletions daemon/algod/api/server/v2/dryrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1257,12 +1257,12 @@ func TestDryrunCost(t *testing.T) {

for _, test := range tests {
t.Run(test.msg, func(t *testing.T) {
costs := make([]uint64, 2)
costs := make([]int64, 2)

ops, err := logic.AssembleString("#pragma version 5\nbyte 0x41\n" + strings.Repeat("keccak256\n", test.numHashes) + "pop\nint 1\n")
require.NoError(t, err)
approval := ops.Program
costs[0] = 3 + uint64(test.numHashes)*130
costs[0] = 3 + int64(test.numHashes)*130

ops, err = logic.AssembleString("int 1")
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion daemon/algod/api/server/v2/generated/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e5aa557

Please sign in to comment.