Skip to content

Commit 009d16d

Browse files
committed
chore: cleanup r1
1 parent b64abcc commit 009d16d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/utils/cairoDataTypes/uint256.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ export class CairoUint256 {
6464
return bigInt;
6565
}
6666

67+
/**
68+
* Validate if low and high can be represented as Unit256
69+
*/
6770
static validateProps(low: BigNumberish, high: BigNumberish) {
6871
const bigIntLow = BigInt(low);
6972
const bigIntHigh = BigInt(high);

src/utils/calldata/requestParser.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
CairoEnum,
88
ParsedStruct,
99
Tupled,
10-
Uint256,
1110
} from '../../types';
1211
import { CairoUint256 } from '../cairoDataTypes/uint256';
1312
import { encodeShortString, isText, splitLongString } from '../shortString';
@@ -75,10 +74,6 @@ function parseTuple(element: object, typeStr: string): Tupled[] {
7574
});
7675
}
7776

78-
function parseUint256(element: object | BigNumberish) {
79-
return new CairoUint256(element as Uint256).toApiRequest();
80-
}
81-
8277
function parseByteArray(element: string): string[] {
8378
const myByteArray: ByteArray = byteArrayFromString(element);
8479
return [
@@ -128,7 +123,7 @@ function parseCalldataValue(
128123
// checking if the passed element is struct
129124
if (structs[type] && structs[type].members.length) {
130125
if (CairoUint256.isAbiType(type)) {
131-
return parseUint256(element);
126+
return new CairoUint256(element as any).toApiRequest();
132127
}
133128

134129
if (type === 'core::starknet::eth_address::EthAddress')
@@ -154,7 +149,7 @@ function parseCalldataValue(
154149
}
155150
// check if u256 C1v0
156151
if (CairoUint256.isAbiType(type)) {
157-
return parseUint256(element);
152+
return new CairoUint256(element as any).toApiRequest();
158153
}
159154
// check if Enum
160155
if (isTypeEnum(type, enums)) {

0 commit comments

Comments
 (0)