@@ -32,6 +32,52 @@ func TestNewRoundData(t *testing.T) {
3232 require .Equal (t , expectedRound , actualRound )
3333}
3434
35+ func TestNewRoundData_ProxyPhasePrefixedRoundID (t * testing.T ) {
36+ t .Parallel ()
37+
38+ testCases := []struct {
39+ name string
40+ roundIDHex string
41+ expectedRound uint32
42+ }{
43+ {
44+ name : "DAI/USD phase 1" ,
45+ roundIDHex : "0x100000000000000000000000000010c80" ,
46+ expectedRound : 0x10c80 ,
47+ },
48+ {
49+ name : "USDC/USD phase 1" ,
50+ roundIDHex : "0x10000000000000000000000000001192e" ,
51+ expectedRound : 0x1192e ,
52+ },
53+ {
54+ name : "ETH/USD phase 1" ,
55+ roundIDHex : "0x10000000000000000000000000001664b" ,
56+ expectedRound : 0x1664b ,
57+ },
58+ }
59+
60+ for _ , tc := range testCases {
61+ t .Run (tc .name , func (t * testing.T ) {
62+ t .Parallel ()
63+
64+ raw := []string {
65+ tc .roundIDHex ,
66+ "0x5f5e100" ,
67+ "0x1087" ,
68+ "0x633344a3" ,
69+ "0x633344a5" ,
70+ }
71+ felts , err := starknetutils .HexArrToFelt (raw )
72+ require .NoError (t , err )
73+
74+ actualRound , err := NewRoundData (felts )
75+ require .NoError (t , err )
76+ require .Equal (t , tc .expectedRound , actualRound .RoundID )
77+ })
78+ }
79+ }
80+
3581// Helpers
3682
3783func bigIntFromString (s string ) * big.Int {
0 commit comments