Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run e2e tests for newly deployed chains #781

Open
andrii-kl opened this issue Nov 9, 2022 · 7 comments
Open

Run e2e tests for newly deployed chains #781

andrii-kl opened this issue Nov 9, 2022 · 7 comments
Assignees
Labels
go Pull requests that update Go code type: test

Comments

@andrii-kl
Copy link
Collaborator

andrii-kl commented Nov 9, 2022

Using existing artifacts from task #780 run e2e test.

@andrii-kl andrii-kl added type: test go Pull requests that update Go code labels Nov 9, 2022
@manishbista28
Copy link
Collaborator

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

@andrii-kl
Copy link
Collaborator Author

andrii-kl commented Nov 10, 2022

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 andrii-kl self-assigned this Nov 15, 2022
@andrii-kl
Copy link
Collaborator Author

Blocked: #798

@andrii-kl
Copy link
Collaborator Author


=== 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
Copy link
Collaborator Author

andrii-kl commented Nov 15, 2022

Summary:

  1. Current E2E tests have issues with new token names. Some issues have been resolved, some not.
    fix(e2e): handle wrapped coin intra-chain transfer (#798) #799
    fix(e2e): Extend GetCoinBalance function to handle new token/coin nam… #804

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

@andrii-kl
Copy link
Collaborator Author

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


  1. 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
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code type: test
Projects
None yet
Development

No branches or pull requests

2 participants