Skip to content

Commit 3ae5ed5

Browse files
committed
rename
1 parent 43310e3 commit 3ae5ed5

File tree

3 files changed

+25
-29
lines changed

3 files changed

+25
-29
lines changed

contracts/interface/ITransferHistory.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ interface ITransferHistory {
77
address to;
88
address from;
99
uint256 amount;
10-
uint256 recipientBalanceBeforeTx;
11-
uint256 senderBalanceBeforeTx;
10+
uint256 preBalanceOfRecipient;
11+
uint256 preBalanceOfSender;
1212
bool filled;
1313
uint256 blockNumber;
1414
}

contracts/src/withdraw/Withdraw.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ contract Withdraw is InitializableUsingRegistry, IWithdraw, ITransferHistory {
206206
hId - 1
207207
];
208208
lastHistory.amount =
209-
lastHistory.senderBalanceBeforeTx -
209+
lastHistory.preBalanceOfSender -
210210
_property.balanceOf(lastHistory.from);
211211
lastHistory.filled = true;
212212
}

test/withdraw/withdraw.ts

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -354,26 +354,26 @@ contract('WithdrawTest', ([deployer, user1, , user3]) => {
354354
to: string
355355
from: string
356356
amount: BigNumber
357-
recipientBalanceBeforeTx: BigNumber
358-
senderBalanceBeforeTx: BigNumber
357+
preBalanceOfRecipient: BigNumber
358+
preBalanceOfSender: BigNumber
359359
filled: boolean
360360
blockNumber: BigNumber
361361
} => {
362362
const [
363363
to,
364364
from,
365365
amount,
366-
recipientBalanceBeforeTx,
367-
senderBalanceBeforeTx,
366+
preBalanceOfRecipient,
367+
preBalanceOfSender,
368368
filled,
369369
blockNumber,
370370
] = src
371371
return {
372372
to,
373373
from,
374374
amount: toBigNumber(amount),
375-
recipientBalanceBeforeTx: toBigNumber(recipientBalanceBeforeTx),
376-
senderBalanceBeforeTx: toBigNumber(senderBalanceBeforeTx),
375+
preBalanceOfRecipient: toBigNumber(preBalanceOfRecipient),
376+
preBalanceOfSender: toBigNumber(preBalanceOfSender),
377377
filled,
378378
blockNumber: toBigNumber(blockNumber),
379379
}
@@ -383,8 +383,8 @@ contract('WithdrawTest', ([deployer, user1, , user3]) => {
383383
const data = await dev.withdraw.transferHistory(property.address, 0)
384384
const res = toStruct(data)
385385
expect(res.amount.toNumber()).to.be.equal(0)
386-
expect(res.senderBalanceBeforeTx.toNumber()).to.be.equal(0)
387-
expect(res.recipientBalanceBeforeTx.toNumber()).to.be.equal(0)
386+
expect(res.preBalanceOfSender.toNumber()).to.be.equal(0)
387+
expect(res.preBalanceOfRecipient.toNumber()).to.be.equal(0)
388388
expect(res.blockNumber.toNumber()).to.be.equal(0)
389389
expect(res.to).to.be.equal(DEFAULT_ADDRESS)
390390
expect(res.from).to.be.equal(DEFAULT_ADDRESS)
@@ -408,10 +408,8 @@ contract('WithdrawTest', ([deployer, user1, , user3]) => {
408408

409409
const res1 = toStruct(data1)
410410
expect(res1.amount.toNumber()).to.be.equal(0) // Initially, it's 0
411-
expect(res1.senderBalanceBeforeTx.toFixed()).to.be.equal(
412-
balance1.toFixed()
413-
)
414-
expect(res1.recipientBalanceBeforeTx.toFixed()).to.be.equal(
411+
expect(res1.preBalanceOfSender.toFixed()).to.be.equal(balance1.toFixed())
412+
expect(res1.preBalanceOfRecipient.toFixed()).to.be.equal(
415413
balance2.toFixed()
416414
)
417415
expect(res1.blockNumber.toNumber()).to.be.equal(block1)
@@ -421,10 +419,8 @@ contract('WithdrawTest', ([deployer, user1, , user3]) => {
421419

422420
const res2 = toStruct(data2)
423421
expect(res2.amount.toNumber()).to.be.equal(0) // Initially, it's 0
424-
expect(res2.senderBalanceBeforeTx.toFixed()).to.be.equal(
425-
balance3.toFixed()
426-
)
427-
expect(res2.recipientBalanceBeforeTx.toFixed()).to.be.equal(
422+
expect(res2.preBalanceOfSender.toFixed()).to.be.equal(balance3.toFixed())
423+
expect(res2.preBalanceOfRecipient.toFixed()).to.be.equal(
428424
balance4.toFixed()
429425
)
430426
expect(res2.blockNumber.toNumber()).to.be.equal(block2)
@@ -719,10 +715,10 @@ contract('WithdrawTest', ([deployer, user1, , user3]) => {
719715
expect(r1.from).to.be.equal(Alice)
720716
expect(r1.to).to.be.equal(Bob)
721717
expect(r1.amount.toFixed()).to.be.equal('0')
722-
expect(r1.senderBalanceBeforeTx.toFixed()).to.be.equal(
718+
expect(r1.preBalanceOfSender.toFixed()).to.be.equal(
723719
balanceAlice.toFixed()
724720
)
725-
expect(r1.recipientBalanceBeforeTx.toFixed()).to.be.equal(
721+
expect(r1.preBalanceOfRecipient.toFixed()).to.be.equal(
726722
balanceBob.toFixed()
727723
)
728724
expect(r1.filled).to.be.equal(false)
@@ -813,10 +809,10 @@ contract('WithdrawTest', ([deployer, user1, , user3]) => {
813809
expect(r1.from).to.be.equal(Bob)
814810
expect(r1.to).to.be.equal(Carol)
815811
expect(r1.amount.toFixed()).to.be.equal('0')
816-
expect(r1.senderBalanceBeforeTx.toFixed()).to.be.equal(
812+
expect(r1.preBalanceOfSender.toFixed()).to.be.equal(
817813
balanceBob.toFixed()
818814
)
819-
expect(r1.recipientBalanceBeforeTx.toFixed()).to.be.equal(
815+
expect(r1.preBalanceOfRecipient.toFixed()).to.be.equal(
820816
balanceCarol.toFixed()
821817
)
822818
expect(r1.filled).to.be.equal(false)
@@ -901,10 +897,10 @@ contract('WithdrawTest', ([deployer, user1, , user3]) => {
901897
expect(r1.from).to.be.equal(Bob)
902898
expect(r1.to).to.be.equal(Carol)
903899
expect(r1.amount.toFixed()).to.be.equal('0')
904-
expect(r1.senderBalanceBeforeTx.toFixed()).to.be.equal(
900+
expect(r1.preBalanceOfSender.toFixed()).to.be.equal(
905901
balanceBob.toFixed()
906902
)
907-
expect(r1.recipientBalanceBeforeTx.toFixed()).to.be.equal(
903+
expect(r1.preBalanceOfRecipient.toFixed()).to.be.equal(
908904
balanceCarol.toFixed()
909905
)
910906
expect(r1.filled).to.be.equal(false)
@@ -919,10 +915,10 @@ contract('WithdrawTest', ([deployer, user1, , user3]) => {
919915

920916
expect(r1.from).to.be.equal(Alice)
921917
expect(r1.to).to.be.equal(Bob)
922-
expect(r1.senderBalanceBeforeTx.toFixed()).to.be.equal(
918+
expect(r1.preBalanceOfSender.toFixed()).to.be.equal(
923919
balanceAliceProp1$1.toFixed()
924920
)
925-
expect(r1.recipientBalanceBeforeTx.toFixed()).to.be.equal(
921+
expect(r1.preBalanceOfRecipient.toFixed()).to.be.equal(
926922
balanceBobProp1$1.toFixed()
927923
)
928924
expect(r1.blockNumber.toNumber()).to.be.equal(blockNumberProp1$1)
@@ -936,10 +932,10 @@ contract('WithdrawTest', ([deployer, user1, , user3]) => {
936932

937933
expect(r1.from).to.be.equal(Bob)
938934
expect(r1.to).to.be.equal(Carol)
939-
expect(r1.senderBalanceBeforeTx.toFixed()).to.be.equal(
935+
expect(r1.preBalanceOfSender.toFixed()).to.be.equal(
940936
balanceBobProp2$1.toFixed()
941937
)
942-
expect(r1.recipientBalanceBeforeTx.toFixed()).to.be.equal(
938+
expect(r1.preBalanceOfRecipient.toFixed()).to.be.equal(
943939
balanceCarolProp2$1.toFixed()
944940
)
945941
expect(r1.blockNumber.toNumber()).to.be.equal(blockNumberProp2$1)

0 commit comments

Comments
 (0)