diff --git a/go/enclave/rpc/GetTransactionReceipt.go b/go/enclave/rpc/GetTransactionReceipt.go index a119a7f1a..107a2c90d 100644 --- a/go/enclave/rpc/GetTransactionReceipt.go +++ b/go/enclave/rpc/GetTransactionReceipt.go @@ -145,8 +145,8 @@ func isAddress(topics []gethcommon.Hash, nr int, requester *gethcommon.Address) if len(topics) < nr+1 { return false } - topic := gethcommon.Address(topics[nr].Bytes()) - return topic == *requester + addressFromTopic := gethcommon.BytesToAddress(topics[nr].Bytes()) + return addressFromTopic == *requester } // marshalReceipt marshals a transaction receipt into a JSON object. diff --git a/go/host/enclave/service.go b/go/host/enclave/service.go index c0eab697c..e027e26c4 100644 --- a/go/host/enclave/service.go +++ b/go/host/enclave/service.go @@ -127,7 +127,7 @@ func (e *Service) EvictEnclave(enclaveID *common.EnclaveID) { e.haLock.Lock() defer e.haLock.Unlock() for i, guardian := range e.enclaveGuardians { - if guardian.GetEnclaveID() == enclaveID { + if *(guardian.GetEnclaveID()) == *enclaveID { failedEnclaveIdx = i break } @@ -141,7 +141,7 @@ func (e *Service) EvictEnclave(enclaveID *common.EnclaveID) { e.enclaveGuardians = append(e.enclaveGuardians[:failedEnclaveIdx], e.enclaveGuardians[failedEnclaveIdx+1:]...) e.logger.Warn("Evicted enclave from HA pool.", log.EnclaveIDKey, enclaveID) - if e.activeSequencerID == enclaveID { + if *e.activeSequencerID == *enclaveID { // sequencer enclave has failed, so we need to select another one to promote as the active sequencer var i int for i = 0; i < len(e.enclaveGuardians); i++ { diff --git a/integration/networktest/tests/nodescenario/sequencer_multi_enclave_test.go b/integration/networktest/tests/nodescenario/sequencer_multi_enclave_test.go index 7226e71c5..3e16b07c5 100644 --- a/integration/networktest/tests/nodescenario/sequencer_multi_enclave_test.go +++ b/integration/networktest/tests/nodescenario/sequencer_multi_enclave_test.go @@ -38,7 +38,7 @@ func TestMultiEnclaveSequencer(t *testing.T) { // This test runs with an HA sequencer, does a transfer then kills the active sequencer enclave, // allows it time to failover then performs another transfer to check the failover was successful. // Note: this is a happy path failover, we need to test for edge cases etc and test the failover in a live testnet -func TestHASequencerFailover(t *testing.T) { +func TestHASequencerBackup(t *testing.T) { networktest.TestOnlyRunsInIDE(t) doubleTransferAmount := big.NewInt(2).Mul(big.NewInt(2), _transferAmount) networktest.Run(