Skip to content

Commit

Permalink
REPLICATION #240
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel committed Aug 17, 2022
1 parent e9a95d5 commit b026ba5
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions x/ccv/difftest/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ func (n Network) addAck(sender string, ack []byte, packet channeltypes.Packet) {
}

func (n Network) consumePackets(sender string, num int64) []Packet {

ret := []Packet{}
for _, p := range n.outboxPackets[sender][:num] {
if 1 < p.commits {
Expand Down Expand Up @@ -247,7 +246,9 @@ func (s *DTTestSuite) sendEmptyVSCPacket() {

s.idempotentUpdateClient(C)

_, err = difftest.TryRecvPacket(s.endpoint(P), s.endpoint(C), packet)
ack, err := difftest.TryRecvPacket(s.endpoint(P), s.endpoint(C), packet)

s.network.addAck(P, ack, packet)

s.Require().NoError(err)
}
Expand Down Expand Up @@ -306,10 +307,6 @@ func (s *DTTestSuite) SetupTest() {

}

// for i := 0; i < 4; i++ {
// fmt.Println(i, " ", s.valAddresses[i].Bytes(), s.consAddr(int64(i)))
// }

s.setSigningInfos()

tmConfig := ibctesting.NewTendermintConfig()
Expand Down Expand Up @@ -396,8 +393,6 @@ func (s *DTTestSuite) SetupTest() {
s.idempotentBeginBlock(P)
s.idempotentBeginBlock(C)

// s.network = makeNetwork()

}

/*
Expand Down Expand Up @@ -529,15 +524,12 @@ func (s *DTTestSuite) idempotentBeginBlock(chain string) {
}

func (s *DTTestSuite) idempotentDeliverAcks(receiver string) error {
_ = func() error {
for _, ack := range s.network.consumeAcks(s.other(receiver)) {
s.idempotentUpdateClient(receiver)
err := difftest.TryRecvAck(s.endpoint(s.other(receiver)), s.endpoint(receiver), ack.packet, ack.ack)
if err != nil {
return err
}
for _, ack := range s.network.consumeAcks(s.other(receiver)) {
s.idempotentUpdateClient(receiver)
err := difftest.TryRecvAck(s.endpoint(s.other(receiver)), s.endpoint(receiver), ack.packet, ack.ack)
if err != nil {
return err
}
return nil
}
return nil
}
Expand Down

0 comments on commit b026ba5

Please sign in to comment.