Skip to content

Commit 90e1e81

Browse files
authored
fix (scheduler): inject expected wrapping in payload (#1336)
# Related Github tickets fixes VolumeFi#2543 # Testing completed - [x] test coverage exists or has been added/updated - [x] tested in a private testnet # Breaking changes - [x] I have checked my code for breaking changes - [x] If there are breaking changes, there is a supporting migration.
1 parent 9c3197c commit 90e1e81

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

x/scheduler/bindings/msg_plugin.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package bindings
22

33
import (
44
"context"
5+
"encoding/hex"
6+
"fmt"
57

68
sdkerrors "cosmossdk.io/errors"
79
wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types"
@@ -99,9 +101,12 @@ func (m *customMessenger) executeJob(ctx sdk.Context, contractAddr sdk.AccAddres
99101
return nil, nil, nil, wasmvmtypes.InvalidRequest{Err: "missing payload"}
100102
}
101103

104+
hexString := hex.EncodeToString(e.Payload)
105+
injected := []byte(fmt.Sprintf("{\"hexPayload\":\"%s\"}", hexString))
106+
102107
// We use the keeper method here instead of going via msg server,
103108
// as that will allow us to set the sender contract address.
104-
_, err := m.k.ExecuteJob(ctx, e.JobID, e.Payload, contractAddr, contractAddr)
109+
_, err := m.k.ExecuteJob(ctx, e.JobID, injected, contractAddr, contractAddr)
105110
if err != nil {
106111
return nil, nil, nil, sdkerrors.Wrap(err, "failed to trigger job execution.")
107112
}

0 commit comments

Comments
 (0)