Skip to content

Commit da0245c

Browse files
committed
[Bug] CoinbaseAccount ID is not always a GUID
1 parent 46d0eb8 commit da0245c

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

CoinbasePro.Specs/JsonFixtures/Services/CoinbaseAccounts/AllCoinbaseResponseFixture.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static string Create()
4646
""primary"": true,
4747
""active"": true
4848
},
49-
{
49+
{
5050
""id"": ""2a11354e-f133-5771-8a37-622be9b239db"",
5151
""name"": ""EUR Wallet"",
5252
""balance"": ""0.00"",
@@ -64,6 +64,18 @@ public static string Create()
6464
""account_address"": ""9th Floor, 107 Cheapside, London, EC2V 6DN, United Kingdom"",
6565
""reference"": ""CBAEUXOVFXOXYX""
6666
}
67+
},
68+
{
69+
""id"": ""LINK"",
70+
""name"": ""LINK Wallet"",
71+
""balance"": ""0.00"",
72+
""currency"": ""LINK"",
73+
""type"": ""wallet"",
74+
""primary"": false,
75+
""active"": true,
76+
""available_on_consumer"": true,
77+
""hold_balance"": ""0.00"",
78+
""hold_currency"": ""USD""
6779
}
6880
]";
6981

CoinbasePro.Specs/Services/CoinbaseAccounts/CoinbaseAccountsServiceSpecs.cs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ class when_getting_all_coinbase_accounts
3232
result = Subject.GetAllAccountsAsync().Result;
3333

3434
It should_have_correct_count = () =>
35-
result.Count().ShouldEqual(4);
35+
result.Count().ShouldEqual(5);
3636

3737
It should_have_correct_ETH_account_information = () =>
3838
{
39-
result.First().Id.ShouldEqual(new Guid("fc3a8a57-7142-542d-8436-95a3d82e1622"));
39+
result.First().Id.ShouldEqual("fc3a8a57-7142-542d-8436-95a3d82e1622");
4040
result.First().Name.ShouldEqual("ETH Wallet");
4141
result.First().Balance.ShouldEqual(0.00000000M);
4242
result.First().Currency.ShouldEqual(Currency.ETH);
@@ -49,7 +49,7 @@ class when_getting_all_coinbase_accounts
4949
{
5050
var usAccount = result.Skip(1).First();
5151

52-
usAccount.Id.ShouldEqual(new Guid("2ae3354e-f1c3-5771-8a37-6228e9d239db"));
52+
usAccount.Id.ShouldEqual("2ae3354e-f1c3-5771-8a37-6228e9d239db");
5353
usAccount.Name.ShouldEqual("USD Wallet");
5454
usAccount.Balance.ShouldEqual(0.00M);
5555
usAccount.CoinbaseAccountType.ShouldEqual(CoinbaseAccountType.Fiat);
@@ -71,7 +71,7 @@ class when_getting_all_coinbase_accounts
7171
{
7272
var btcAccount = result.Skip(2).First();
7373

74-
btcAccount.Id.ShouldEqual(new Guid("1bfad868-5223-5d3c-8a22-b5ed371e55cb"));
74+
btcAccount.Id.ShouldEqual("1bfad868-5223-5d3c-8a22-b5ed371e55cb");
7575
btcAccount.Name.ShouldEqual("BTC Wallet");
7676
btcAccount.Balance.ShouldEqual(0.00000000M);
7777
btcAccount.Currency.ShouldEqual(Currency.BTC);
@@ -82,9 +82,9 @@ class when_getting_all_coinbase_accounts
8282

8383
It should_have_correct_EU_account_information = () =>
8484
{
85-
var euAccount = result.Last();
85+
var euAccount = result.Skip(3).First();
8686

87-
euAccount.Id.ShouldEqual(new Guid("2a11354e-f133-5771-8a37-622be9b239db"));
87+
euAccount.Id.ShouldEqual("2a11354e-f133-5771-8a37-622be9b239db");
8888
euAccount.Name.ShouldEqual("EUR Wallet");
8989
euAccount.Balance.ShouldEqual(0.00M);
9090
euAccount.CoinbaseAccountType.ShouldEqual(CoinbaseAccountType.Fiat);
@@ -100,6 +100,18 @@ class when_getting_all_coinbase_accounts
100100
"9th Floor, 107 Cheapside, London, EC2V 6DN, United Kingdom");
101101
euAccount.SepaDepositInformation.Reference.ShouldEqual("CBAEUXOVFXOXYX");
102102
};
103+
104+
It should_have_correct_LINK_account_information = () =>
105+
{
106+
var linkAccount = result.Last();
107+
108+
linkAccount.Id.ShouldEqual("LINK");
109+
linkAccount.Name.ShouldEqual("LINK Wallet");
110+
linkAccount.Balance.ShouldEqual(0.00M);
111+
linkAccount.CoinbaseAccountType.ShouldEqual(CoinbaseAccountType.Wallet);
112+
linkAccount.Primary.ShouldBeFalse();
113+
linkAccount.Active.ShouldBeTrue();
114+
};
103115
}
104116
}
105117
}

CoinbasePro/Services/CoinbaseAccounts/Models/CoinbaseAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace CoinbasePro.Services.CoinbaseAccounts.Models
99
{
1010
public class CoinbaseAccount
1111
{
12-
public Guid Id { get; set; }
12+
public string Id { get; set; }
1313

1414
public string Name { get; set; }
1515

0 commit comments

Comments
 (0)