init339398989
This commit is contained in:
@@ -260,7 +260,7 @@ export async function signAndBroadcastRawTron(p: SignRawTronParams): Promise<{ t
|
||||
// Если у нас неизвестный selector (LiFi bridge calls, custom routers) — мы НЕ можем
|
||||
// передать "0x..." как function_selector (TronGrid keccak'нёт строку и получит
|
||||
// полностью другие 4 байта → contract revert). Используем `data` напрямую.
|
||||
let data = p.callData.startsWith('0x') ? p.callData.slice(2) : p.callData;
|
||||
const data = p.callData.startsWith('0x') ? p.callData.slice(2) : p.callData;
|
||||
if (data.length < 8) throw new Error('TRX call data too short (need >= 4-byte selector)');
|
||||
const selector8 = data.slice(0, 8);
|
||||
const knownCanonical = lookupKnownSelector(selector8);
|
||||
@@ -294,7 +294,12 @@ export async function signAndBroadcastRawTron(p: SignRawTronParams): Promise<{ t
|
||||
if (!simOk) {
|
||||
const rawMsg = simRes?.result?.message;
|
||||
const msgDecoded = rawMsg
|
||||
? Buffer.from(rawMsg, 'hex').toString().replace(/[ | ||||