Skip to content

Commit 4a59fc2

Browse files
committed
feat: added uea migration changes
1 parent ecb73e0 commit 4a59fc2

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

test/integration/uexecutor/inbound_initiated_outbound_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ func setupInboundInitiatedOutboundTest(t *testing.T, numVals int) (*app.ChainApp
116116

117117
ueModuleAccAddress, _ := app.UexecutorKeeper.GetUeModuleAddress(ctx)
118118
receipt, err := app.UexecutorKeeper.DeployUEAV2(ctx, ueModuleAccAddress, validUA)
119-
ueaAddrHex := common.BytesToAddress(receipt.Ret)
120119
require.NoError(t, err)
120+
ueaAddrHex := common.BytesToAddress(receipt.Ret)
121121

122122
// signature
123123
validVerificationData := "0xa7531ada733322bd6708c94cba5a7dbd1ce25bccf010f774777b039713fc330643e23b7ef2a4609244900c6ab9a03d83d3ecf73edf6b451f21cc7dbda625a3211b"

test/integration/uexecutor/vote_inbound_validation_test.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,16 @@ func TestVoteInboundValidation(t *testing.T) {
123123
t.Run("inbound with invalid payload records failed PCTx", func(t *testing.T) {
124124
chainApp, ctx, vals, coreVals, _ := setupInboundValidationTest(t, 4)
125125

126-
// Construct a FUNDS_AND_PAYLOAD inbound with a malformed UniversalPayload:
127-
// empty "to" encodes as zero address in RawPayload, passes ValidateForExecution,
128-
// but fails at EVM execution level. The failure is recorded as a failed PCTx.
126+
// Construct a FUNDS_AND_PAYLOAD inbound whose payload will revert at EVM execution.
127+
// The UEA's executeUniversalTx skips verification for module-sender calls, so we
128+
// must trigger a revert in the execution step itself.
129+
// Strategy: call the Handler contract with an invalid function selector — the
130+
// Handler has no fallback, so the low-level .call() returns success=false and
131+
// the UEA reverts with ExecutionFailed().
129132
malformedPayload := &uexecutortypes.UniversalPayload{
130-
To: "", // empty "to" address -- fails at EVM execution
133+
To: utils.GetDefaultAddresses().HandlerAddr.Hex(), // real contract, no fallback
131134
Value: "0",
132-
Data: "0x",
135+
Data: "0xdeadbeef", // invalid selector — no matching function
133136
GasLimit: "21000000",
134137
MaxFeePerGas: "1000000000",
135138
MaxPriorityFeePerGas: "200000000",

test/utils/bytecode.go

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

x/uexecutor/keeper/evm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func (k Keeper) CallUEAExecutePayload(
184184
false, // gasless = false (@dev: we need gas to be emitted in the tx receipt)
185185
false, // not a module sender
186186
nil,
187-
"executePayload",
187+
"executeUniversalTx",
188188
abiUniversalPayload,
189189
verificationData,
190190
)

x/uexecutor/types/abi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const FactoryV1ABI = `[
181181
const UeaV1ABI = `[
182182
{
183183
"type": "function",
184-
"name": "executePayload",
184+
"name": "executeUniversalTx",
185185
"inputs": [
186186
{
187187
"name": "payload",

x/uexecutor/types/constants.go

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)