Skip to content

Commit 59602b9

Browse files
committed
xchain DestinationTag
1 parent 31a464e commit 59602b9

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

xrpl/transaction/escrow_create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (e *EscrowCreate) Flatten() FlatTransaction {
7474
flattened["Condition"] = e.Condition
7575
}
7676
if e.DestinationTag != nil {
77-
flattened["DestinationTag"] = e.DestinationTag
77+
flattened["DestinationTag"] = *e.DestinationTag
7878
}
7979

8080
return flattened

xrpl/transaction/payment_channel_create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (p *PaymentChannelCreate) Flatten() FlatTransaction {
6464
}
6565

6666
if p.DestinationTag != nil {
67-
flattened["DestinationTag"] = p.DestinationTag
67+
flattened["DestinationTag"] = *p.DestinationTag
6868
}
6969

7070
return flattened

xrpl/transaction/xchain_claim.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type XChainClaim struct {
5656
// won't be destroyed, and the transaction can be rerun with a different destination.
5757
Destination types.Address
5858
// An integer destination tag.
59-
DestinationTag uint32 `json:",omitempty"`
59+
DestinationTag *uint32 `json:",omitempty"`
6060
// The bridge to use for the transfer.
6161
XChainBridge types.XChainBridge
6262
// The unique integer ID for the cross-chain transfer that was referenced in the corresponding XChainCommit transaction.
@@ -82,8 +82,8 @@ func (x *XChainClaim) Flatten() FlatTransaction {
8282
flatTx["Destination"] = x.Destination.String()
8383
}
8484

85-
if x.DestinationTag != 0 {
86-
flatTx["DestinationTag"] = x.DestinationTag
85+
if x.DestinationTag != nil {
86+
flatTx["DestinationTag"] = *x.DestinationTag
8787
}
8888

8989
if x.XChainBridge != (types.XChainBridge{}) {

xrpl/transaction/xchain_claim_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestXChainClaim_Flatten(t *testing.T) {
3838
},
3939
Amount: types.XRPCurrencyAmount(1000000000),
4040
Destination: "r9cZA1mR1tMM4Gx5JqZxtFU1XxHtHa3gE3",
41-
DestinationTag: 1,
41+
DestinationTag: DestinationTag(1),
4242
XChainBridge: types.XChainBridge{
4343
LockingChainDoor: "r9cZA1mR1tMM4Gx5JqZxtFU1XxHtHa3gE3",
4444
LockingChainIssue: "r9cZA1mR1tMM4Gx5JqZxtFU1XxHtHa3gE3",
@@ -144,7 +144,7 @@ func TestXChainClaim_Validate(t *testing.T) {
144144
},
145145
Amount: types.XRPCurrencyAmount(1000000000),
146146
Destination: "r9cZA1mR1tMM4Gx5JqZxtFU1XxHtHa3gE3",
147-
DestinationTag: 1,
147+
DestinationTag: DestinationTag(1),
148148
XChainBridge: types.XChainBridge{
149149
LockingChainDoor: "r9cZA1mR1tMM4Gx5JqZxtFU1XxHtHa3gE3",
150150
LockingChainIssue: "r9cZA1mR1tMM4Gx5JqZxtFU1XxHtHa3gE3",

0 commit comments

Comments
 (0)