Update project structure and build process

This commit is contained in:
Juan Pablo Civile
2025-05-13 11:10:08 -03:00
parent 124e9fa1bc
commit d9f3e925a4
277 changed files with 15321 additions and 930 deletions

View File

@@ -0,0 +1,27 @@
package newop
import (
"testing"
"github.com/shopspring/decimal"
)
func TestExchangeWindowConvert(t *testing.T) {
window := &ExchangeRateWindow{}
window.AddRate("BTC", 1)
window.AddRate("USD", 32_000)
amount := NewMonetaryAmountFromSatoshis(100_000_000)
converted := window.convert(amount, "USD")
if converted.Currency != "USD" {
t.Fatalf("expected converted currency to be USD, got %v", converted.Currency)
}
if converted.Value.Cmp(decimal.NewFromInt(32_000)) != 0 {
t.Fatalf("expected converted amount to be 32000, got %v", converted.Value)
}
}