@@ -129,20 +129,15 @@ func (provider *ErgoToErgoExtractionBridge) ExtractDirectTransferRequest(ctx con
129
129
rqId := new (big.Int )
130
130
rqId , _ = rqId .SetString (rq .RequestId , 10 )
131
131
fmt .Println (rqId )
132
- //amount := new(big.Int)
133
132
amount , err := strconv .ParseInt (rq .Amount , 10 , 64 )
134
133
bigAmount := big .NewInt (amount )
135
134
fmt .Println (bigAmount )
136
- //amount, _ = amount.SetString(rq.Amount, 10)
137
135
138
136
sourceDecimals := big .NewInt (10 )
139
137
sourceDecimals .Exp (sourceDecimals , big .NewInt (provider .config .SourceDecimals ), nil )
140
- //sourceDecimals := math.Pow(10, float64(provider.config.DestinationDecimals))
141
138
destinationDecimals := big .NewInt (10 )
142
139
destinationDecimals .Exp (destinationDecimals , big .NewInt (provider .config .DestinationDecimals ), nil )
143
- //destinationDecimals := math.Pow(10, float64(provider.config.DestinationDecimals))
144
140
145
- //newAmount := int64(float64(amount) * sourceDecimals / destinationDecimals)
146
141
newAmount := bigAmount .
147
142
Mul (bigAmount , destinationDecimals ).
148
143
Div (bigAmount , sourceDecimals ).Int64 ()
@@ -179,19 +174,14 @@ func (provider *ErgoToErgoExtractionBridge) ExtractReverseTransferRequest(ctx co
179
174
rqId := new (big.Int )
180
175
rqId , _ = rqId .SetString (rq .RequestId , 10 )
181
176
182
- //amount := new(big.Int)
183
177
amount , err := strconv .ParseInt (rq .Amount , 10 , 64 )
184
178
bigAmount := big .NewInt (amount )
185
- //amount, _ = amount.SetString(rq.Amount, 10)
186
179
187
180
sourceDecimals := big .NewInt (10 )
188
181
sourceDecimals .Exp (sourceDecimals , big .NewInt (provider .config .SourceDecimals ), nil )
189
- //sourceDecimals := math.Pow(10, float64(provider.config.DestinationDecimals))
190
182
destinationDecimals := big .NewInt (10 )
191
183
destinationDecimals .Exp (destinationDecimals , big .NewInt (provider .config .DestinationDecimals ), nil )
192
- //destinationDecimals := math.Pow(10, float64(provider.config.DestinationDecimals))
193
184
194
- //newAmount := int64(float64(amount) * sourceDecimals / destinationDecimals)
195
185
newAmount := bigAmount .
196
186
Mul (bigAmount , destinationDecimals ).
197
187
Div (bigAmount , sourceDecimals ).Int64 ()
0 commit comments