Skip to content

Commit

Permalink
fix(adapter-non-local.test.js): operation.amount asset adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
gitmp01 committed Nov 6, 2024
1 parent a105fac commit c769386
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions cpp/test/adapter-non-local.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,14 +552,6 @@ describe('Adapter EVM -> EOS testing', () => {
const operation = evmOperationSamples.pegin
const metadata = evmMetadataSamples.pegin

const amount = operation.amount / 10 ** evmPrecision

const quantity = `${amount} TST`
const xquantity = `${adjustPrecision(amount, evmXERC20.precision)} XTST`
const normalizedAmount = ethers
.parseUnits(Asset.from(quantity).value.toString(), 18)
.toString()

const before = getAccountsBalances(
[user, recipient, adapter.account, feemanager],
[evmXERC20],
Expand All @@ -574,7 +566,7 @@ describe('Adapter EVM -> EOS testing', () => {
[evmXERC20],
)

expect(after[recipient][evmXERC20.symbol]).to.be.equal(xquantity)
expect(after[recipient][evmXERC20.symbol]).to.be.equal(operation.amount)

expect(after[adapter.account][evmXERC20.symbol]).to.be.equal(
`0.0000 ${evmXERC20.symbol}`,
Expand All @@ -588,14 +580,6 @@ describe('Adapter EVM -> EOS testing', () => {
it('Should settle the operation properly and send userdata', async () => {
const operation = evmOperationSamples.peginWithUserData
const metadata = evmMetadataSamples.peginWithUserData
const amount = operation.amount / 10 ** evmPrecision

const quantity = `${amount} TST`
const xquantity = `${adjustPrecision(amount, evmXERC20.precision)} XTST`
const normalizedAmount = ethers
.parseUnits(Asset.from(quantity).value.toString(), 18)
.toString()
const xquantityAsset = Asset.from(xquantity)

const before = getAccountsBalances(
[user, recipient, adapter.account],
Expand All @@ -613,7 +597,7 @@ describe('Adapter EVM -> EOS testing', () => {
)

expect(after[recipient][evmXERC20.symbol]).to.equal(
sum(xquantityAsset, beforeAsset).toString(),
sum(operation.amount, beforeAsset).toString(),
)

expect(after[adapter.account][evmXERC20.symbol]).to.be.equal(
Expand Down

0 comments on commit c769386

Please sign in to comment.