icon-project / icon-bridge

The centralized bridge of ICON
Apache License 2.0
21 stars 15 forks source link

Run e2e tests for newly deployed chains #781

Open andrii-kl opened 1 year ago

andrii-kl commented 1 year ago

Using existing artifacts from task #780 run e2e test.

manishbista28 commented 1 year ago

were there any thrown when you ran the tests @andrii-kl ?

andrii-kl commented 1 year ago

In some reason bsc handle transaction instead of snow. Should I configure anything in addition?

I|23:18:06.760740|----|-|main|main.go:33 Initializing service
I|23:18:06.761709|----|-|main|main.go:54 Running Service
E|23:18:11.598652|----|-|main|main.go:57 executor.New : NewApi newRequestAPI Expected cfg.NetwrkID=0xnid.bsc Got 0x228.snow
Exiting.
andrii-kl commented 1 year ago

Blocked: https://github.com/icon-project/icon-bridge/issues/798

andrii-kl commented 1 year ago

=== RUN   TestTransferIntraChain
    api_test.go:44: Transaction Hash bnUSD 0x071e549ca8bd78b5ea7904b1f6d9e0c9cddaa04baea531954142f31e38c27a91
    api_test.go:49: Receipt &{StatusCode:0 ElInfo:[] Raw:0xc000400d00}
    api_test.go:54: callContract balanceOf : Call : jsonrpc: code: -30006, message: SCOREError(-30006): E0006:InvalidParameter(type=Address,json="0x33283649E9FE9C11c4b47761E1bdb1603571226c"), data: E0006:InvalidParameter(type=Address,json="0x33283649E9FE9C11c4b47761E1bdb1603571226c")
        github.com/icon-project/goloop/common/errors.Code.Wrapf
            /work/common/errors/errors.go:100
        github.com/icon-project/goloop/service/scoreapi.TypeTag.ConvertJSONToTypedObj
            /work/service/scoreapi/method.go:157
        github.com/icon-project/goloop/service/scoreapi.DataType.ConvertJSONToTypedObj
            /work/service/scoreapi/method.go:309
        github.com/icon-project/goloop/service/scoreapi.(*Method).ConvertParamsToTypedObj
            /work/service/scoreapi/method.go:898
        github.com/icon-project/goloop/service/contract.(*CallHandler).ensureMethodAndParams
            /work/service/contract/callhandler.go:362
        github.com/icon-project/goloop/service/contract.(*CallHandler).DoExecuteAsync
            /work/service/contract/callhandler.go:233
        github.com/icon-project/goloop/icon.(*callHandler).ExecuteAsync
            /work/icon/callhandler.go:58
        github.com/icon-project/goloop/service/contract.(*callContext).runFrame
            /work/service/contract/callcontext.go:257
        github.com/icon-project/goloop/service/contract.(*callContext).Call
            /work/service/contract/callcontext.go:242
        github.com/icon-project/goloop/service.(*QueryHandler).Query
            /work/service/queryhandler.go:61
        github.com/icon-project/goloop/service.(*manager).Call
            /work/service/manager.go:488
        github.com/icon-project/goloop/server/v3.call
            /work/server/v3/api_v3.go:243
        github.com/icon-project/goloop/server/jsonrpc.(*MethodRepository).handle
            /work/server/jsonrpc/method.go:114
        github.com/icon-project/goloop/server/jsonrpc.(*MethodRepository).Handle
            /work/server/jsonrpc/method.go:175
        github.com/icon-project/goloop/server.ChainInjector.func1.1
            /work/server/middleware.go:42
        github.com/icon-project/goloop/server.Chunk.func1.1
            /work/server/middleware.go:61
        Wrapping E1002:IllegalArgument
--- FAIL: TestTransferIntraChain (10.48s)

FAIL
andrii-kl commented 1 year ago

Summary:

  1. Current E2E tests have issues with new token names. Some issues have been resolved, some not. https://github.com/icon-project/icon-bridge/pull/799 https://github.com/icon-project/icon-bridge/pull/804

  2. Exchange of coins and tokens was tested on both sides.

andrii-kl commented 1 year ago

ICON -> SNOW

1) Approve transfer

=== RUN   TestApprove
    api_test.go:100: Hash 0x14af46eaaa1b61751afe73dceea7058f7be06f8de80b78bd955764124c4010c6 Receipt &{To:cx4ebd82979bdd76b10ea858373bbf8add9894293e CumulativeStepUsed:0xa7f25 StepUsed:0xa7f25 StepPrice:0x2e90edd00 EventLogs:[{Addr:cx4ebd82979bdd76b10ea858373bbf8add9894293e Indexed:[Transfer(Address,Address,int,bytes) hxe12cef73aff78e0a7ca9a4b316ae3b896ae1c840 cxf265c02737aeebb5846f4a9b85e198aa77ca63ca 0x3bacab37b62e0000] Data:[0x]}] LogsBloom:0x00000000000000000000002000000000000000000000000010000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080080000000000000000000000000000000000000000000000000000000000000000000200000000000000400000000000000000000000400000100000000000000000000000200000000000000000000000000000000000000000000001000000000000010000000000000000800000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Status:0x1 Failure:<nil> SCOREAddress: BlockHash:0x71b806e4364bd79948a92776e2f148a4e0fb1a6ab9422e7c5aeabe7824d2d921 BlockHeight:0xe6d367 TxIndex:0x1 TxHash:0x14af46eaaa1b61751afe73dceea7058f7be06f8de80b78bd955764124c4010c6}
--- PASS: TestApprove (20.37s)
PASS

2) Transfer token (bnUSD)

=== RUN   TestTransferIntraChain
    api_test.go:44: Transaction Hash bnUSD 0x28b4ddcbfe135a557f0ded7a54d3b095fbff1175f2bea3a2b005772175fec30b
    api_test.go:49: Receipt &{StatusCode:1 ElInfo:[] Raw:0xc0003eea90}
    api_test.go:56: Balance Usable 0 Locked 0 Refundable 0 UserBalance 4300000000000000000
--- PASS: TestTransferIntraChain (11.00s)


"BTSCore": "0x33283649E9FE9C11c4b47761E1bdb1603571226c",

Transaction hash (icon): 0x9ad4e9f0f259e0087be3837edd0596fe8b8fb0b57f6a140b725587e095d88c48

Check balance (snow)


balanceOf bnUSD 
_owner: 0x33283649E9FE9C11c4b47761E1bdb1603571226c
_coinName: bnUSD
 _userBalance 2757000000000000000
andrii-kl commented 1 year ago

SNOW -> ICON

  1. Approve transfer
=== RUN   TestApprove
    api_test.go:43: ApproveHash 0x9c245f28b521d958079e8ad712c2ffe9a2677ce4483ab3b56fb42e798294bdaa 
    api_test.go:48: Hash 0x9c245f28b521d958079e8ad712c2ffe9a2677ce4483ab3b56fb42e798294bdaa Receipt &{Type:0 PostState:[] Status:1 CumulativeGasUsed:46234 Bloom:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 0 0 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16 0 0 0 0 0 0 0 32 0 128 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0] Logs:[0xc000168790] TxHash:0x9c245f28b521d958079e8ad712c2ffe9a2677ce4483ab3b56fb42e798294bdaa ContractAddress:0x0000000000000000000000000000000000000000 GasUsed:46234 BlockHash:0x5ccbc696a13f5e381e4d75b2b16427f40889b14dff613d2a417c3ec959505ef0 BlockNumber:+672961 TransactionIndex:0}
--- PASS: TestApprove (17.22s)
PASS
  1. Transfer token (bnUSD snow -> icon)
RUN   TestTransferIntraChain
    api_test.go:67: Hash 0x35d9c5f8d2368cf0b83799e5f925e94d4c3aca5f98cddb9139e96b66074b6980
    api_test.go:73: Receipt &{StatusCode:0 ElInfo:[] Raw:0xc000548000}
--- PASS: TestTransferIntraChain (22.42s)
PASS

=== RUN   TestTransferIntraChain
    api_test.go:67: Hash 0x23334da82f86c3481068b021cbd5ff8ed51f80b84ab3bb0b37118bbb4fae5b6e
    api_test.go:73: Receipt &{StatusCode:0 ElInfo:[] Raw:0xc0002036c0}
--- PASS: TestTransferIntraChain (37.12s)
PASS