Skip to content

Commit 4371152

Browse files
authored
Update Zenon SDK to version 0.6.4 (#6)
1 parent b4375d9 commit 4371152

File tree

13 files changed

+35
-35
lines changed

13 files changed

+35
-35
lines changed

src/ZenonCli/Commands/Bridge.Admin.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,16 @@ protected override async Task ProcessAsync()
136136
WriteInfo("Setting token pair ...");
137137

138138
var setTokenPair = ZnnClient.Embedded.Bridge.SetTokenPair(
139-
NetworkClass!.Value,
140-
ChainId!.Value,
139+
(uint)NetworkClass!.Value,
140+
(uint)ChainId!.Value,
141141
tokenStandard,
142142
TokenAddress,
143143
Bridgeable!.Value,
144144
Redeemable!.Value,
145145
Owned!.Value,
146146
minAmount,
147147
feePercentage,
148-
RedeemDelay!.Value,
148+
(ulong)RedeemDelay!.Value,
149149
Metadata);
150150
await ZnnClient.Send(setTokenPair);
151151

@@ -177,7 +177,7 @@ protected override async Task ProcessAsync()
177177
WriteInfo("Removing token pair ...");
178178

179179
var removeTokenPair = ZnnClient.Embedded.Bridge
180-
.RemoveTokenPair(NetworkClass!.Value, ChainId!.Value, tokenStandard, TokenAddress);
180+
.RemoveTokenPair((uint)NetworkClass!.Value, (uint)ChainId!.Value, tokenStandard, TokenAddress);
181181
await ZnnClient.Send(removeTokenPair);
182182

183183
WriteInfo("Done");
@@ -191,7 +191,7 @@ public class Revoke : KeyStoreAndConnectionCommand
191191
public string? TransactionHash { get; set; }
192192

193193
[Value(1, MetaName = "logIndex", Required = true, HelpText = "The log index in the block of the transaction that locked/burned the funds")]
194-
public int? LogIndex { get; set; }
194+
public long? LogIndex { get; set; }
195195

196196
protected override async Task ProcessAsync()
197197
{
@@ -202,7 +202,7 @@ protected override async Task ProcessAsync()
202202
WriteInfo("Revoking unwrap request ...");
203203

204204
var revokeUnwrapRequest =
205-
ZnnClient.Embedded.Bridge.RevokeUnwrapRequest(transactionHash, LogIndex!.Value);
205+
ZnnClient.Embedded.Bridge.RevokeUnwrapRequest(transactionHash, (uint)LogIndex!.Value);
206206
await ZnnClient.Send(revokeUnwrapRequest);
207207

208208
WriteInfo("Done");
@@ -362,10 +362,10 @@ protected override async Task ProcessAsync()
362362
await AssertBridgeAdminAsync();
363363

364364
WriteInfo("Setting orchestrator information...");
365-
await ZnnClient.Send(ZnnClient.Embedded.Bridge.SetOrchestratorInfo(WindowSize!.Value,
366-
KeyGenThreshold!.Value,
367-
ConfirmationsToFinality!.Value,
368-
EstimatedMomentumTime!.Value));
365+
await ZnnClient.Send(ZnnClient.Embedded.Bridge.SetOrchestratorInfo((ulong)WindowSize!.Value,
366+
(uint)KeyGenThreshold!.Value,
367+
(uint)ConfirmationsToFinality!.Value,
368+
(uint)EstimatedMomentumTime!.Value));
369369
WriteInfo("Done");
370370
}
371371
}
@@ -425,7 +425,7 @@ protected override async Task ProcessAsync()
425425

426426
WriteInfo("Setting bridge network...");
427427
await ZnnClient.Send(ZnnClient.Embedded.Bridge.SetNetwork(
428-
networkClass, chainId, name, contractAddress, Metadata));
428+
(uint)networkClass, (uint)chainId, name, contractAddress, Metadata));
429429
WriteInfo("Done");
430430
}
431431
}
@@ -460,7 +460,7 @@ protected override async Task ProcessAsync()
460460

461461

462462
WriteInfo("Removing bridge network...");
463-
await ZnnClient.Send(ZnnClient.Embedded.Bridge.RemoveNetwork(networkClass, chainId));
463+
await ZnnClient.Send(ZnnClient.Embedded.Bridge.RemoveNetwork((uint)networkClass, (uint)chainId));
464464
WriteInfo("Done");
465465
}
466466
}
@@ -499,7 +499,7 @@ protected override async Task ProcessAsync()
499499
JsonConvert.DeserializeObject(Metadata!);
500500

501501
WriteInfo("Setting bridge network metadata...");
502-
await ZnnClient.Send(ZnnClient.Embedded.Bridge.SetNetworkMetadata(networkClass, chainId, Metadata!));
502+
await ZnnClient.Send(ZnnClient.Embedded.Bridge.SetNetworkMetadata((uint)networkClass, (uint)chainId, Metadata!));
503503
WriteInfo("Done");
504504
}
505505
}
@@ -515,7 +515,7 @@ protected override async Task ProcessAsync()
515515
await AssertBridgeAdminAsync();
516516

517517
WriteInfo("Setting bridge redeem delay...");
518-
await ZnnClient.Send(ZnnClient.Embedded.Bridge.SetRedeemDelay(RedeemDelay!.Value));
518+
await ZnnClient.Send(ZnnClient.Embedded.Bridge.SetRedeemDelay((ulong)RedeemDelay!.Value));
519519
WriteInfo("Done");
520520
}
521521
}

src/ZenonCli/Commands/Bridge.Network.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ protected override async Task ProcessAsync()
4444
}
4545

4646
var network = await ZnnClient.Embedded.Bridge.GetNetworkInfo(
47-
this.NetworkClass!.Value,
48-
this.ChainId!.Value);
47+
(uint)this.NetworkClass!.Value,
48+
(uint)this.ChainId!.Value);
4949

5050
if (network.NetworkClass == 0 || network.ChainId == 0)
5151
{

src/ZenonCli/Commands/Bridge.Unwrap.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ public class Redeem : KeyStoreAndConnectionCommand
1414
public string? Hash { get; set; }
1515

1616
[Value(1, MetaName = "logIndex", Required = true, HelpText = "The log index")]
17-
public int? LogIndex { get; set; }
17+
public long? LogIndex { get; set; }
1818

1919
protected override async Task ProcessAsync()
2020
{
2121
var address = ZnnClient.DefaultKeyPair.Address;
2222
var transactionHash = ParseHash(Hash);
2323

2424
var request = await ZnnClient.Embedded.Bridge
25-
.GetUnwrapTokenRequestByHashAndLog(transactionHash, LogIndex!.Value);
25+
.GetUnwrapTokenRequestByHashAndLog(transactionHash, (uint)LogIndex!.Value);
2626

2727
if (request.Redeemed == 0 && request.Revoked == 0)
2828
{
@@ -190,14 +190,14 @@ public class Get : ConnectionCommand
190190
public string? Hash { get; set; }
191191

192192
[Value(1, MetaName = "logIndex", Required = true, HelpText = "The log index")]
193-
public int? LogIndex { get; set; }
193+
public long? LogIndex { get; set; }
194194

195195
protected override async Task ProcessAsync()
196196
{
197197
var transactionHash = ParseHash(Hash);
198198

199199
var request = await ZnnClient.Embedded.Bridge
200-
.GetUnwrapTokenRequestByHashAndLog(transactionHash, LogIndex!.Value);
200+
.GetUnwrapTokenRequestByHashAndLog(transactionHash, (uint)LogIndex!.Value);
201201

202202
await WriteAsync(request);
203203
}

src/ZenonCli/Commands/Bridge.Wrap.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected override async Task ProcessAsync()
4141
await AssertBalanceAsync(address, tokenStandard, amount);
4242

4343
var info =
44-
await ZnnClient.Embedded.Bridge.GetNetworkInfo(this.NetworkClass!.Value, this.ChainId!.Value);
44+
await ZnnClient.Embedded.Bridge.GetNetworkInfo((uint)this.NetworkClass!.Value, (uint)this.ChainId!.Value);
4545

4646
if (info.NetworkClass == 0 || info.ChainId == 0)
4747
{
@@ -65,7 +65,7 @@ protected override async Task ProcessAsync()
6565

6666
WriteInfo("Wrapping token ...");
6767
var wrapToken = ZnnClient.Embedded.Bridge
68-
.WrapToken(NetworkClass!.Value, ChainId!.Value, ToAddress, amount, tokenStandard);
68+
.WrapToken((uint)NetworkClass!.Value, (uint)ChainId!.Value, ToAddress, amount, tokenStandard);
6969
await ZnnClient.Send(wrapToken);
7070
WriteInfo("Done");
7171
}
@@ -110,7 +110,7 @@ protected override async Task ProcessAsync()
110110
{
111111
list = await ZnnClient.Embedded.Bridge
112112
.GetAllWrapTokenRequestsByToAddressNetworkClassAndChainId(
113-
Address, NetworkClass!.Value, ChainId!.Value);
113+
Address, (uint)NetworkClass!.Value, (uint)ChainId!.Value);
114114
}
115115
else
116116
{

src/ZenonCli/Commands/CommandBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected async Task ConnectAsync(IConnectionOptions options)
126126
{
127127
if (!String.Equals(options.Chain, "auto", StringComparison.OrdinalIgnoreCase))
128128
{
129-
ZnnClient.ChainIdentifier = int.Parse(options.Chain);
129+
ZnnClient.ChainIdentifier = ulong.Parse(options.Chain);
130130
}
131131
else
132132
{

src/ZenonCli/Commands/Htlc.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected override async Task ProcessAsync()
137137

138138
long expirationTime = this.ExpirationTime * 60 * 60; // convert to seconds
139139
Momentum currentFrontierMomentum = await ZnnClient.Ledger.GetFrontierMomentum();
140-
long currentTime = currentFrontierMomentum.Timestamp;
140+
long currentTime = (long)currentFrontierMomentum.Timestamp;
141141
expirationTime += currentTime;
142142

143143
if (this.HashLock != null)

src/ZenonCli/Commands/Orchestrator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public class UnwrapToken : KeyStoreAndConnectionCommand
116116
public string? TransactionHash { get; set; }
117117

118118
[Value(3, MetaName = "logIndex", Required = true, HelpText = "The log index in the block of the transaction that locked/burned the funds on the source network; together with txHash it creates a unique identifier for a transaction")]
119-
public int? LogIndex { get; set; }
119+
public long? LogIndex { get; set; }
120120

121121
[Value(4, MetaName = "address", Required = true, HelpText = "The destination NoM address")]
122122
public string? Address { get; set; }

src/ZenonCli/Commands/Plasma.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected override async Task ProcessAsync()
2727

2828
var address = ZnnClient.DefaultKeyPair.Address;
2929
var fusionEntryList = await ZnnClient.Embedded.Plasma.GetEntriesByAddress(address,
30-
this.PageIndex.Value, this.PageSize.Value);
30+
(uint)this.PageIndex.Value, (uint)this.PageSize.Value);
3131

3232
if (fusionEntryList.Count > 0)
3333
{
@@ -131,7 +131,7 @@ protected override async Task ProcessAsync()
131131
}
132132
pageIndex++;
133133
fusions = await ZnnClient.Embedded.Plasma
134-
.GetEntriesByAddress(address, pageIndex: pageIndex);
134+
.GetEntriesByAddress(address, (uint)pageIndex);
135135
}
136136

137137
if (!found)

src/ZenonCli/Commands/Spork.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected override async Task ProcessAsync()
2525
AssertPageRange(PageIndex.Value, PageSize.Value);
2626

2727
var result = await ZnnClient.Embedded.Spork
28-
.GetAll(PageIndex.Value, PageSize.Value);
28+
.GetAll((uint)PageIndex.Value, (uint)PageSize.Value);
2929

3030
if (result == null || result.Count == 0)
3131
{

src/ZenonCli/Commands/Stake.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected override async Task ProcessAsync()
2929
AssertPageRange(PageIndex.Value, PageSize.Value);
3030

3131
var stakeList = await ZnnClient.Embedded.Stake.GetEntriesByAddress(
32-
address, PageIndex.Value, PageSize.Value);
32+
address, (uint)PageIndex.Value, (uint)PageSize.Value);
3333

3434
if (stakeList.Count > 0)
3535
{
@@ -117,7 +117,7 @@ protected override async Task ProcessAsync()
117117
bool one = false;
118118
bool gotError = false;
119119

120-
var entries = await ZnnClient.Embedded.Stake.GetEntriesByAddress(address, pageIndex);
120+
var entries = await ZnnClient.Embedded.Stake.GetEntriesByAddress(address, (uint)pageIndex);
121121

122122
while (entries.List.Length != 0)
123123
{
@@ -134,7 +134,7 @@ protected override async Task ProcessAsync()
134134
}
135135
}
136136
pageIndex++;
137-
entries = await ZnnClient.Embedded.Stake.GetEntriesByAddress(address, pageIndex);
137+
entries = await ZnnClient.Embedded.Stake.GetEntriesByAddress(address, (uint)pageIndex);
138138
}
139139

140140
if (gotError)

0 commit comments

Comments
 (0)