Skip to content

Commit

Permalink
Add bridging fee 0 to go tests
Browse files Browse the repository at this point in the history
  • Loading branch information
keyleu committed Dec 8, 2023
1 parent 615ca88 commit ede0836
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 8 additions & 8 deletions integration-tests/xrpl/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ func TestXRPAndIssuedTokensPayment(t *testing.T) {
TransactionType: rippledata.PAYMENT,
},
}
t.Logf("Recipinet account balance before: %s", chains.XRPL.GetAccountBalances(ctx, t, recipientAcc))
t.Logf("Recipient account balance before: %s", chains.XRPL.GetAccountBalances(ctx, t, recipientAcc))
require.NoError(t, chains.XRPL.AutoFillSignAndSubmitTx(ctx, t, &fooPaymentTx, issuerAcc))
t.Logf("Recipinet account balance after: %s", chains.XRPL.GetAccountBalances(ctx, t, recipientAcc))
t.Logf("Recipient account balance after: %s", chains.XRPL.GetAccountBalances(ctx, t, recipientAcc))
}

func TestMultisigPayment(t *testing.T) {
Expand Down Expand Up @@ -148,9 +148,9 @@ func TestMultisigPayment(t *testing.T) {
t.Logf("TwoSignersHash/ThreeSignersHash: %s/%s", xrpPaymentTxTwoSigners.Hash, xrpPaymentTxThreeSigners.Hash)
require.NotEqual(t, xrpPaymentTxTwoSigners.Hash.String(), xrpPaymentTxThreeSigners.Hash.String())

t.Logf("Recipinet account balance before: %s", chains.XRPL.GetAccountBalances(ctx, t, xrpPaymentTxTwoSigners.Destination))
t.Logf("Recipient account balance before: %s", chains.XRPL.GetAccountBalances(ctx, t, xrpPaymentTxTwoSigners.Destination))
require.NoError(t, chains.XRPL.SubmitTx(ctx, t, &xrpPaymentTxTwoSigners))
t.Logf("Recipinet account balance after: %s", chains.XRPL.GetAccountBalances(ctx, t, xrpPaymentTxTwoSigners.Destination))
t.Logf("Recipient account balance after: %s", chains.XRPL.GetAccountBalances(ctx, t, xrpPaymentTxTwoSigners.Destination))

// try to submit with three signers (the transaction won't be accepted)
require.ErrorContains(t, chains.XRPL.SubmitTx(ctx, t, &xrpPaymentTxThreeSigners), "This sequence number has already passed")
Expand Down Expand Up @@ -216,9 +216,9 @@ func TestCreateAndUseTicketForPaymentAndTicketsCreation(t *testing.T) {
xrpPaymentTx.TxBase.Sequence = 0
xrpPaymentTx.TicketSequence = createdTickets[0].TicketSequence

t.Logf("Recipinet account balance before: %s", chains.XRPL.GetAccountBalances(ctx, t, recipientAcc))
t.Logf("Recipient account balance before: %s", chains.XRPL.GetAccountBalances(ctx, t, recipientAcc))
require.NoError(t, chains.XRPL.SignAndSubmitTx(ctx, t, &xrpPaymentTx, senderAcc))
t.Logf("Recipinet account balance after: %s", chains.XRPL.GetAccountBalances(ctx, t, recipientAcc))
t.Logf("Recipient account balance after: %s", chains.XRPL.GetAccountBalances(ctx, t, recipientAcc))

// try to use tickets for the transactions without the trust-line
const newFooCurrencyCode = "NFO"
Expand Down Expand Up @@ -450,9 +450,9 @@ func TestMultisigWithMasterKeyRemoval(t *testing.T) {
xrpPaymentTx = buildXrpPaymentTxForMultiSigning(ctx, t, chains.XRPL, multisigAccToDisable, signer1Acc)
require.NoError(t, rippledata.SetSigners(&xrpPaymentTx, signer1, signer2))

t.Logf("Recipinet account balance before: %s", chains.XRPL.GetAccountBalances(ctx, t, xrpPaymentTx.Destination))
t.Logf("Recipient account balance before: %s", chains.XRPL.GetAccountBalances(ctx, t, xrpPaymentTx.Destination))
require.NoError(t, chains.XRPL.SubmitTx(ctx, t, &xrpPaymentTx))
t.Logf("Recipinet account balance after: %s", chains.XRPL.GetAccountBalances(ctx, t, xrpPaymentTx.Destination))
t.Logf("Recipient account balance after: %s", chains.XRPL.GetAccountBalances(ctx, t, xrpPaymentTx.Destination))
}

func TestCreateAndUseUsedTicketAndSequencesWithMultisigning(t *testing.T) {
Expand Down
4 changes: 4 additions & 0 deletions relayer/coreum/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,15 @@ type registerCoreumTokenRequest struct {
Decimals uint32 `json:"decimals"`
SendingPrecision int32 `json:"sending_precision"`
MaxHoldingAmount sdkmath.Int `json:"max_holding_amount"`
BridgingFee sdkmath.Int `json:"bridging_fee"`
}

type registerXRPLTokenRequest struct {
Issuer string `json:"issuer"`
Currency string `json:"currency"`
SendingPrecision int32 `json:"sending_precision"`
MaxHoldingAmount sdkmath.Int `json:"max_holding_amount"`
BridgingFee sdkmath.Int `json:"bridging_fee"`
}

type saveEvidenceRequest struct {
Expand Down Expand Up @@ -497,6 +499,7 @@ func (c *ContractClient) RegisterCoreumToken(ctx context.Context, sender sdk.Acc
Decimals: decimals,
SendingPrecision: sendingPrecision,
MaxHoldingAmount: maxHoldingAmount,
BridgingFee: sdkmath.NewInt(0),
},
},
})
Expand All @@ -521,6 +524,7 @@ func (c *ContractClient) RegisterXRPLToken(ctx context.Context, sender sdk.AccAd
Currency: currency,
SendingPrecision: sendingPrecision,
MaxHoldingAmount: maxHoldingAmount,
BridgingFee: sdkmath.NewInt(0),
},
},
Funds: sdk.NewCoins(fee),
Expand Down

0 comments on commit ede0836

Please sign in to comment.