Skip to content

Commit

Permalink
WIP for axelar integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBolten committed Dec 15, 2023
1 parent 0665ad5 commit 07de54c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 7 additions & 6 deletions integration_tests/axelarcork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (s *IntegrationTestSuite) TestAxelarCork() {
status, err := node.Status(context.Background())
s.Require().NoError(err)
currentBlockHeight := status.SyncInfo.LatestBlockHeight
targetBlockHeight := currentBlockHeight + 15
targetBlockHeight := uint64(currentBlockHeight + 15)
deadline := uint64(time.Now().Unix() + int64(time.Hour.Seconds()))

s.T().Logf("Scheduling axelar cork calls for height %d", targetBlockHeight)
Expand All @@ -129,8 +129,9 @@ func (s *IntegrationTestSuite) TestAxelarCork() {
TargetContractAddress: counterContract.Hex(),
Deadline: deadline,
}
axelarCorkID := axelarCork.IDHash(uint64(targetBlockHeight))
s.T().Logf("Axelar cork ID is %s", hex.EncodeToString(axelarCorkID))
axelarCorkID := axelarCork.IDHash(targetBlockHeight)
axelarCorkIDHex := hex.EncodeToString(axelarCorkID)
s.T().Logf("Axelar cork ID is %s", axelarCorkIDHex)
for i, orch := range s.chain.orchestrators {
i := i
orch := orch
Expand All @@ -141,7 +142,7 @@ func (s *IntegrationTestSuite) TestAxelarCork() {
ABIEncodedInc(),
counterContract,
deadline,
uint64(targetBlockHeight),
targetBlockHeight,
orch.address())
s.Require().NoError(err, "Failed to construct axelar cork")
response, err := s.chain.sendMsgs(*clientCtx, axelarCorkMsg)
Expand All @@ -168,8 +169,8 @@ func (s *IntegrationTestSuite) TestAxelarCork() {
s.Require().Equal(cork0.Cork.TargetContractAddress, counterContract.Hex())
s.Require().Equal(cork0.Cork.Deadline, deadline)
s.Require().Equal(cork0.BlockHeight, targetBlockHeight)
s.Require().Equal(cork0.Id, axelarCorkID)
s.Require().Equal(cork0.Validator, val0.address())
s.Require().Equal(cork0.Id, axelarCorkIDHex)
//s.Require().Equal(cork0.Validator, val0.address().String())

// schedule a normal cork
// scheduled cork proposal
Expand Down
4 changes: 4 additions & 0 deletions integration_tests/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ func (v *validator) address() sdk.AccAddress {
return addr
}

func (v *validator) validatorAddress() sdk.ValAddress {

Check failure on line 360 in integration_tests/validator.go

View workflow job for this annotation

GitHub Actions / golangci-lint

func `(*validator).validatorAddress` is unused (unused)
return nil
}

func (v *validator) pubKey() cryptotypes.PubKey {
pubKey, err := v.keyRecord.GetPubKey()
if err != nil {
Expand Down

0 comments on commit 07de54c

Please sign in to comment.