Skip to content

Commit e494979

Browse files
committed
update kc token name references to kda
1 parent fdb6502 commit e494979

File tree

5 files changed

+76
-76
lines changed

5 files changed

+76
-76
lines changed

integrationTests/mock/KleverContractStateMock.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ type kleverBlockchainContractStateMock struct {
6666
lastExecutedEthBatchId uint64
6767
lastExecutedEthTxId uint64
6868

69-
ProposeMultiTransferEsdtBatchCalled func()
69+
ProposeMultiTransferKdaBatchCalled func()
7070
}
7171

7272
func newKleverBlockchainContractStateMock() *kleverBlockchainContractStateMock {
@@ -92,12 +92,12 @@ func (mock *kleverBlockchainContractStateMock) processTransaction(tx *transactio
9292
dataSplit := strings.Split(string(tx.GetRawData().GetData()[0]), "@")
9393
funcName := dataSplit[0]
9494
switch funcName {
95-
case "proposeEsdtSafeSetCurrentTransactionBatchStatus":
96-
mock.proposeEsdtSafeSetCurrentTransactionBatchStatus(dataSplit, tx)
95+
case "proposeKdaSafeSetCurrentTransactionBatchStatus":
96+
mock.proposeKdaSafeSetCurrentTransactionBatchStatus(dataSplit, tx)
9797

9898
return
99-
case "proposeMultiTransferEsdtBatch":
100-
mock.proposeMultiTransferEsdtBatch(dataSplit, tx)
99+
case "proposeMultiTransferKdaBatch":
100+
mock.proposeMultiTransferKdaBatch(dataSplit, tx)
101101
return
102102
case "sign":
103103
mock.sign(dataSplit, tx)
@@ -114,19 +114,19 @@ func (mock *kleverBlockchainContractStateMock) processTransaction(tx *transactio
114114
panic("can not execute transaction that calls function: " + funcName)
115115
}
116116

117-
func (mock *kleverBlockchainContractStateMock) proposeEsdtSafeSetCurrentTransactionBatchStatus(dataSplit []string, _ *transaction.Transaction) {
117+
func (mock *kleverBlockchainContractStateMock) proposeKdaSafeSetCurrentTransactionBatchStatus(dataSplit []string, _ *transaction.Transaction) {
118118
status, hash := mock.createProposedStatus(dataSplit)
119119

120120
mock.proposedStatus[hash] = status
121121
}
122122

123-
func (mock *kleverBlockchainContractStateMock) proposeMultiTransferEsdtBatch(dataSplit []string, _ *transaction.Transaction) {
123+
func (mock *kleverBlockchainContractStateMock) proposeMultiTransferKdaBatch(dataSplit []string, _ *transaction.Transaction) {
124124
transfer, hash := mock.createProposedTransfer(dataSplit)
125125

126126
mock.proposedTransfers[hash] = transfer
127127

128-
if mock.ProposeMultiTransferEsdtBatchCalled != nil {
129-
mock.ProposeMultiTransferEsdtBatchCalled()
128+
if mock.ProposeMultiTransferKdaBatchCalled != nil {
129+
mock.ProposeMultiTransferKdaBatchCalled()
130130
}
131131
}
132132

integrationTests/mock/ethereumChainMock.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@ type EthereumProposedTransfer struct {
2828

2929
// EthereumChainMock -
3030
type EthereumChainMock struct {
31-
mutState sync.RWMutex
32-
nonces map[common.Address]uint64
33-
batches map[uint64]*contract.Batch
34-
deposits map[uint64][]contract.Deposit
35-
proposedTransfer *EthereumProposedTransfer
36-
totalBalances map[common.Address]*big.Int
37-
mintBalances map[common.Address]*big.Int
38-
burnBalances map[common.Address]*big.Int
39-
mintBurnTokens map[common.Address]bool
40-
nativeTokens map[common.Address]bool
41-
whitelistedTokens map[common.Address]bool
42-
GetStatusesAfterExecutionHandler func() ([]byte, bool)
43-
ProcessFinishedHandler func()
44-
quorum int
45-
relayers []common.Address
46-
ProposeMultiTransferEsdtBatchCalled func()
47-
BalanceAtCalled func(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
48-
FilterLogsCalled func(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
49-
finalNonce uint64
31+
mutState sync.RWMutex
32+
nonces map[common.Address]uint64
33+
batches map[uint64]*contract.Batch
34+
deposits map[uint64][]contract.Deposit
35+
proposedTransfer *EthereumProposedTransfer
36+
totalBalances map[common.Address]*big.Int
37+
mintBalances map[common.Address]*big.Int
38+
burnBalances map[common.Address]*big.Int
39+
mintBurnTokens map[common.Address]bool
40+
nativeTokens map[common.Address]bool
41+
whitelistedTokens map[common.Address]bool
42+
GetStatusesAfterExecutionHandler func() ([]byte, bool)
43+
ProcessFinishedHandler func()
44+
quorum int
45+
relayers []common.Address
46+
ProposeMultiTransferKdaBatchCalled func()
47+
BalanceAtCalled func(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
48+
FilterLogsCalled func(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
49+
finalNonce uint64
5050
}
5151

5252
// NewEthereumChainMock -
@@ -232,8 +232,8 @@ func (mock *EthereumChainMock) ExecuteTransfer(_ *bind.TransactOpts, tokens []co
232232
mock.proposedTransfer = proposedTransfer
233233
mock.mutState.Unlock()
234234

235-
if mock.ProposeMultiTransferEsdtBatchCalled != nil {
236-
mock.ProposeMultiTransferEsdtBatchCalled()
235+
if mock.ProposeMultiTransferKdaBatchCalled != nil {
236+
mock.ProposeMultiTransferKdaBatchCalled()
237237
}
238238

239239
return tx, nil

integrationTests/relayers/kcToEth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func testRelayersShouldExecuteTransfersFromKcToEthIfTransactionsAppearInBatch(t
181181
kcChainMock.SetPendingBatch(&pendingBatch)
182182
kcChainMock.SetQuorum(numRelayers)
183183

184-
ethereumChainMock.ProposeMultiTransferEsdtBatchCalled = func() {
184+
ethereumChainMock.ProposeMultiTransferKdaBatchCalled = func() {
185185
deposit := deposits[0]
186186

187187
kcChainMock.AddDepositToCurrentBatch(deposit)

integrationTests/relayers/slowTests/framework/kcHandler.go

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -42,40 +42,40 @@ const (
4242
bridgeProxyContractPath = "testdata/contracts/kda/bridge-proxy.wasm"
4343
testCallerContractPath = "testdata/contracts/kda/test-caller.wasm"
4444

45-
setBridgeProxyContractAddressFunction = "setBridgeProxyContractAddress"
46-
setWrappingContractAddressFunction = "setWrappingContractAddress"
47-
changeOwnerAddressFunction = "ChangeOwnerAddress"
48-
setEsdtSafeOnMultiTransferFunction = "setEsdtSafeOnMultiTransfer"
49-
setEsdtSafeOnWrapperFunction = "setEsdtSafeContractAddress"
50-
setEsdtSafeAddressFunction = "setEsdtSafeAddress"
51-
stakeFunction = "stake"
52-
unpauseFunction = "unpause"
53-
unpauseEsdtSafeFunction = "unpauseEsdtSafe"
54-
unpauseProxyFunction = "unpauseProxy"
55-
pauseEsdtSafeFunction = "pauseEsdtSafe"
56-
pauseFunction = "pause"
57-
issueFunction = "issue"
58-
setSpecialRoleFunction = "setSpecialRole"
59-
kdaTransferFunction = "KDATransfer"
60-
setPairDecimalsFunction = "setPairDecimals"
61-
addWrappedTokenFunction = "addWrappedToken"
62-
depositLiquidityFunction = "depositLiquidity"
63-
whitelistTokenFunction = "whitelistToken"
64-
addMappingFunction = "addMapping"
65-
kdaSafeAddTokenToWhitelistFunction = "kdaSafeAddTokenToWhitelist"
66-
kdaSafeSetMaxBridgedAmountForTokenFunction = "kdaSafeSetMaxBridgedAmountForToken"
67-
multiTransferEsdtSetMaxBridgedAmountForTokenFunction = "multiTransferEsdtSetMaxBridgedAmountForToken"
68-
submitBatchFunction = "submitBatch"
69-
unwrapTokenCreateTransactionFunction = "unwrapTokenCreateTransaction"
70-
createTransactionFunction = "createTransaction"
71-
setBridgedTokensWrapperAddressFunction = "setBridgedTokensWrapperAddress"
72-
setMultiTransferAddressFunction = "setMultiTransferAddress"
73-
withdrawRefundFeesForEthereumFunction = "withdrawRefundFeesForEthereum"
74-
getRefundFeesForEthereumFunction = "getRefundFeesForEthereum"
75-
withdrawTransactionFeesFunction = "withdrawTransactionFees"
76-
getTransactionFeesFunction = "getTransactionFees"
77-
initSupplyMintBurnEsdtSafe = "initSupplyMintBurnEsdtSafe"
78-
initSupplyEsdtSafe = "initSupplyEsdtSafe"
45+
setBridgeProxyContractAddressFunction = "setBridgeProxyContractAddress"
46+
setWrappingContractAddressFunction = "setWrappingContractAddress"
47+
changeOwnerAddressFunction = "ChangeOwnerAddress"
48+
setKdaSafeOnMultiTransferFunction = "setKdaSafeOnMultiTransfer"
49+
setKdaSafeOnWrapperFunction = "setKdaSafeContractAddress"
50+
setKdaSafeAddressFunction = "setKdaSafeAddress"
51+
stakeFunction = "stake"
52+
unpauseFunction = "unpause"
53+
unpauseKdaSafeFunction = "unpauseKdaSafe"
54+
unpauseProxyFunction = "unpauseProxy"
55+
pauseKdaSafeFunction = "pauseKdaSafe"
56+
pauseFunction = "pause"
57+
issueFunction = "issue"
58+
setSpecialRoleFunction = "setSpecialRole"
59+
kdaTransferFunction = "KDATransfer"
60+
setPairDecimalsFunction = "setPairDecimals"
61+
addWrappedTokenFunction = "addWrappedToken"
62+
depositLiquidityFunction = "depositLiquidity"
63+
whitelistTokenFunction = "whitelistToken"
64+
addMappingFunction = "addMapping"
65+
kdaSafeAddTokenToWhitelistFunction = "kdaSafeAddTokenToWhitelist"
66+
kdaSafeSetMaxBridgedAmountForTokenFunction = "kdaSafeSetMaxBridgedAmountForToken"
67+
multiTransferKdaSetMaxBridgedAmountForTokenFunction = "multiTransferKdaSetMaxBridgedAmountForToken"
68+
submitBatchFunction = "submitBatch"
69+
unwrapTokenCreateTransactionFunction = "unwrapTokenCreateTransaction"
70+
createTransactionFunction = "createTransaction"
71+
setBridgedTokensWrapperAddressFunction = "setBridgedTokensWrapperAddress"
72+
setMultiTransferAddressFunction = "setMultiTransferAddress"
73+
withdrawRefundFeesForEthereumFunction = "withdrawRefundFeesForEthereum"
74+
getRefundFeesForEthereumFunction = "getRefundFeesForEthereum"
75+
withdrawTransactionFeesFunction = "withdrawTransactionFees"
76+
getTransactionFeesFunction = "getTransactionFees"
77+
initSupplyMintBurnKdaSafe = "initSupplyMintBurnKdaSafe"
78+
initSupplyKdaSafe = "initSupplyKdaSafe"
7979
)
8080

8181
var (
@@ -309,14 +309,14 @@ func (handler *KcHandler) wireSCProxy(ctx context.Context) {
309309
)
310310
log.Info("Set in SC proxy contract the multi-transfer contract", "transaction hash", hash, "status", txResult.Status)
311311

312-
// setEsdtSafeAddress on bridge proxy
312+
// setKdaSafeAddress on bridge proxy
313313
hash, txResult = handler.ChainSimulator.ScCall(
314314
ctx,
315315
handler.OwnerKeys.KlvSk,
316316
handler.ScProxyAddress,
317317
zeroStringValue,
318318
setCallsGasLimit,
319-
setEsdtSafeAddressFunction,
319+
setKdaSafeAddressFunction,
320320
[]string{
321321
handler.SafeAddress.Hex(),
322322
},
@@ -403,14 +403,14 @@ func (handler *KcHandler) finishSettings(ctx context.Context) {
403403
hash, txResult := handler.callContractNoParams(ctx, handler.MultisigAddress, unpauseProxyFunction)
404404
log.Info("Un-paused SC proxy contract", "transaction hash", hash, "status", txResult.Status)
405405

406-
// setEsdtSafeOnMultiTransfer
406+
// setKdaSafeOnMultiTransfer
407407
hash, txResult = handler.ChainSimulator.ScCall(
408408
ctx,
409409
handler.OwnerKeys.KlvSk,
410410
handler.MultisigAddress,
411411
zeroStringValue,
412412
setCallsGasLimit,
413-
setEsdtSafeOnMultiTransferFunction,
413+
setKdaSafeOnMultiTransferFunction,
414414
[]string{},
415415
)
416416
log.Info("Set in multisig contract the safe contract (automatically)", "transaction hash", hash, "status", txResult.Status)
@@ -493,7 +493,7 @@ func (handler *KcHandler) callContractNoParams(ctx context.Context, contract *Kl
493493
// UnPauseContractsAfterTokenChanges can unpause contracts after token changes
494494
func (handler *KcHandler) UnPauseContractsAfterTokenChanges(ctx context.Context) {
495495
// unpause safe
496-
hash, txResult := handler.callContractNoParams(ctx, handler.MultisigAddress, unpauseEsdtSafeFunction)
496+
hash, txResult := handler.callContractNoParams(ctx, handler.MultisigAddress, unpauseKdaSafeFunction)
497497
log.Info("unpaused safe executed", "hash", hash, "status", txResult.Status)
498498

499499
// unpause wrapper
@@ -508,7 +508,7 @@ func (handler *KcHandler) UnPauseContractsAfterTokenChanges(ctx context.Context)
508508
// PauseContractsForTokenChanges can pause contracts for token changes
509509
func (handler *KcHandler) PauseContractsForTokenChanges(ctx context.Context) {
510510
// pause safe
511-
hash, txResult := handler.callContractNoParams(ctx, handler.MultisigAddress, pauseEsdtSafeFunction)
511+
hash, txResult := handler.callContractNoParams(ctx, handler.MultisigAddress, pauseKdaSafeFunction)
512512
log.Info("paused safe executed", "hash", hash, "status", txResult.Status)
513513

514514
// pause aggregator
@@ -790,7 +790,7 @@ func (handler *KcHandler) setInitialSupply(ctx context.Context, params IssueToke
790790
handler.MultisigAddress,
791791
zeroStringValue,
792792
setCallsGasLimit,
793-
initSupplyMintBurnEsdtSafe,
793+
initSupplyMintBurnKdaSafe,
794794
[]string{
795795
hex.EncodeToString([]byte(tkData.KlvChainSpecificToken)),
796796
hex.EncodeToString(initialSupply.Bytes()),
@@ -810,7 +810,7 @@ func (handler *KcHandler) setInitialSupply(ctx context.Context, params IssueToke
810810
[]string{
811811
hex.EncodeToString([]byte(tkData.KlvChainSpecificToken)),
812812
hex.EncodeToString(initialSupply.Bytes()),
813-
hex.EncodeToString([]byte(initSupplyEsdtSafe)),
813+
hex.EncodeToString([]byte(initSupplyKdaSafe)),
814814
hex.EncodeToString([]byte(tkData.KlvChainSpecificToken)),
815815
hex.EncodeToString(initialSupply.Bytes()),
816816
})
@@ -866,7 +866,7 @@ func (handler *KcHandler) setMaxBridgeAmountOnMultitransfer(ctx context.Context,
866866
handler.MultisigAddress,
867867
zeroStringValue,
868868
setCallsGasLimit,
869-
multiTransferEsdtSetMaxBridgedAmountForTokenFunction,
869+
multiTransferKdaSetMaxBridgedAmountForTokenFunction,
870870
[]string{
871871
hex.EncodeToString([]byte(tkData.KlvChainSpecificToken)),
872872
hex.EncodeToString(maxBridgedAmountForTokenInt.Bytes())})

integrationTests/relayers/slowTests/framework/testSetup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ func (setup *TestSetup) isTransferDoneFromKcForToken(params TestTokenParams) boo
286286
ethTestBalance := setup.EthereumHandler.GetBalance(setup.TestKeys.EthAddress, params.AbstractTokenIdentifier)
287287
isTransferDoneFromKc := ethTestBalance.String() == expectedReceiver.String()
288288

289-
expectedEsdtSafe := big.NewInt(0).Add(initialBalanceForSafe, params.KDASafeExtraBalance)
289+
expectedKdaSafe := big.NewInt(0).Add(initialBalanceForSafe, params.KDASafeExtraBalance)
290290
balanceForSafe := setup.KcHandler.GetKDAChainSpecificTokenBalance(setup.Ctx, setup.KcHandler.SafeAddress, params.AbstractTokenIdentifier)
291-
isSafeContractOnCorrectBalance := expectedEsdtSafe.String() == balanceForSafe.String()
291+
isSafeContractOnCorrectBalance := expectedKdaSafe.String() == balanceForSafe.String()
292292

293293
return isTransferDoneFromKc && isSafeContractOnCorrectBalance
294294
}

0 commit comments

Comments
 (0)