@@ -12,6 +12,7 @@ import {
12
12
} from "./helpers" ;
13
13
import Debugger from "lib/debugger" ;
14
14
import * as Codec from "@truffle/codec" ;
15
+ import Web3 from "web3" ;
15
16
16
17
import txlog from "lib/txlog/selectors" ;
17
18
@@ -228,6 +229,15 @@ describe("Transaction log (visualizer)", function () {
228
229
assert . equal ( call . functionName , "testCall" ) ;
229
230
assert . equal ( call . contractName , "VizTest" ) ;
230
231
assert . equal ( call . returnKind , "return" ) ;
232
+ const expectedSelector = Web3 . utils
233
+ . soliditySha3 ( "testCall(uint256)" )
234
+ . slice ( 0 , 2 + 2 * Codec . Evm . Utils . SELECTOR_SIZE ) ;
235
+ const expectedArgument = Codec . Conversion . toHexString (
236
+ 108 ,
237
+ Codec . Evm . Utils . WORD_SIZE
238
+ ) . slice ( 2 ) ;
239
+ assert . equal ( call . raw . calldata , expectedSelector + expectedArgument ) ;
240
+ assert . notProperty ( call . raw , "binary" ) ;
231
241
debug ( "arguments: %O" , call . arguments ) ;
232
242
let inputs = Codec . Export . unsafeNativizeVariables ( byName ( call . arguments ) ) ;
233
243
debug ( "nativized: %O" , inputs ) ;
@@ -281,6 +291,13 @@ describe("Transaction log (visualizer)", function () {
281
291
assert . isUndefined ( call . functionName ) ;
282
292
assert . equal ( call . contractName , "Secondary" ) ;
283
293
assert . equal ( call . returnKind , "return" ) ;
294
+ const expectedBytecode = abstractions . Secondary . binary ;
295
+ const expectedArgument = Codec . Conversion . toHexString (
296
+ 108 ,
297
+ Codec . Evm . Utils . WORD_SIZE
298
+ ) . slice ( 2 ) ;
299
+ assert . equal ( call . raw . binary , expectedBytecode + expectedArgument ) ;
300
+ assert . notProperty ( call . raw , "calldata" ) ;
284
301
let inputs = Codec . Export . unsafeNativizeVariables ( byName ( call . arguments ) ) ;
285
302
assert . deepEqual ( inputs , {
286
303
y : 108
0 commit comments