File tree 4 files changed +4
-47
lines changed
4 files changed +4
-47
lines changed Original file line number Diff line number Diff line change 1
1
node_modules /
2
2
dist /
3
- www /
4
- src /
3
+ www /
Original file line number Diff line number Diff line change 1
1
import { DecodeConfig } from '../../src/types' ;
2
2
3
3
import {
4
- // Account,
5
4
BigNumberish ,
6
5
CairoUint256 ,
7
- // CairoCustomEnum,
8
- // CairoOption,
9
- // CairoOptionVariant,
10
- // CairoResult,
11
- // CairoResultVariant,
12
- // CairoUint256,
13
- // CairoUint512,
14
6
CallData ,
15
7
Calldata ,
16
- // CompiledSierra,
17
- // Contract,
18
- // DeclareDeployUDCResponse,
19
8
RawArgsArray ,
20
9
RawArgsObject ,
21
- // byteArray,
22
10
cairo ,
23
- // ec,
24
- // hash,
25
- // num,
26
- // selector,
27
- // shortString,
28
- // stark,
29
- // types,
30
- // type Uint512,
31
11
} from '../../src' ;
32
12
33
- import {
34
- // compiledC1v2,
35
- // compiledHelloSierra,
36
- compiledComplexSierra ,
37
- } from '../config/fixtures' ;
13
+ import { compiledComplexSierra } from '../config/fixtures' ;
38
14
39
- const {
40
- // uint256,
41
- tuple,
42
- // isCairo1Abi
43
- } = cairo ;
15
+ const { tuple } = cairo ;
44
16
45
17
describe ( 'Cairo 1' , ( ) => {
46
18
test ( 'should correctly compile and decompile complex data structures' , async ( ) => {
@@ -135,10 +107,9 @@ describe('Cairo 1', () => {
135
107
'constructor' ,
136
108
compiledDataFromArray ,
137
109
config ,
138
- true
139
110
) ;
140
111
141
112
expect ( decompiledDataFromObject ) . toEqual ( myRawArgsObject ) ;
142
- expect ( decompiledDataFromArray ) . toEqual ( myRawArgsArray ) ;
113
+ expect ( decompiledDataFromArray ) . toEqual ( myRawArgsObject ) ;
143
114
} ) ;
144
115
} ) ;
Original file line number Diff line number Diff line change @@ -73,7 +73,6 @@ function decodeBaseTypes(
73
73
case isTypeUint ( type ) :
74
74
switch ( true ) {
75
75
case CairoUint256 . isAbiType ( type ) :
76
- console . log ( 'got 256 uint value' ) ;
77
76
const low = it . next ( ) . value ;
78
77
const high = it . next ( ) . value ;
79
78
@@ -134,7 +133,6 @@ function decodeBaseTypes(
134
133
135
134
case isTypeFelt ( type ) :
136
135
temp = String ( it . next ( ) . value ) ;
137
- console . log ( 'Original temp = ' , temp ) ;
138
136
const configFeltConstructor = config ?. [ 'core::felt252' ] ;
139
137
if ( configFeltConstructor ) {
140
138
if ( configFeltConstructor === String ) return decodeShortString ( temp ) ;
@@ -145,7 +143,6 @@ function decodeBaseTypes(
145
143
return BigInt ( temp ) ;
146
144
147
145
default :
148
- console . log ( 'went to default block for ' ) ;
149
146
temp = it . next ( ) . value ;
150
147
return BigInt ( temp ) ;
151
148
}
@@ -294,7 +291,6 @@ function decodeCalldataValue(
294
291
parsedDataArr . push ( val ) ;
295
292
}
296
293
}
297
- console . log ( 'Returning array: ' , parsedDataArr ) ;
298
294
const configConstructor = config ?. [ element . name ] ;
299
295
if ( configConstructor ) {
300
296
const concatenatedString = parsedDataArr . join ( '' ) ;
Original file line number Diff line number Diff line change @@ -252,7 +252,6 @@ export class CallData {
252
252
method : string ,
253
253
calldata : string [ ] ,
254
254
config ?: DecodeConfig ,
255
- returnArray ?: boolean
256
255
) : RawArgs {
257
256
const abiMethod = this . abi . find (
258
257
( entry ) => entry . name === method && entry . type === 'function'
@@ -273,14 +272,6 @@ export class CallData {
273
272
return acc ;
274
273
} , { } as RawArgsObject ) ;
275
274
276
- if ( returnArray === true ) {
277
- const decodedArgsArray : RawArgsArray = [ ] ;
278
- abiMethod . inputs . forEach ( ( input ) => {
279
- const value = decodedArgs [ input . name ] ;
280
- decodedArgsArray . push ( value ) ;
281
- } ) ;
282
- }
283
-
284
275
return decodedArgs ;
285
276
}
286
277
You can’t perform that action at this time.
0 commit comments