Skip to content

Commit 8710b33

Browse files
author
Maxwell Dulin
committed
Edit implementation to include only a single SetPeer
1 parent 8395240 commit 8710b33

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

sui/packages/wormhole_transceiver/sources/wormhole_transceiver.move

+15-14
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,23 @@ module wormhole_transceiver::wormhole_transceiver {
107107
id: UID
108108
}
109109

110-
public fun set_peer(
111-
_: &AdminCap,
112-
state: &mut State,
113-
chain: u16,
114-
peer: ExternalAddress
115-
) {
116-
if (state.peers.contains(chain)) {
117-
state.peers.remove(chain);
118-
};
119-
state.peers.add(chain, peer);
120-
}
121-
122-
public fun set_peer_with_accountant(_ : &AdminCap, state: &mut State, chain: u16, peer: ExternalAddress): Option<MessageTicket>{
110+
// public fun set_peer(
111+
// _: &AdminCap,
112+
// state: &mut State,
113+
// chain: u16,
114+
// peer: ExternalAddress
115+
// ) {
116+
// if (state.peers.contains(chain)) {
117+
// state.peers.remove(chain);
118+
// };
119+
// state.peers.add(chain, peer);
120+
// }
121+
122+
public fun set_peer(_ : &AdminCap, state: &mut State, chain: u16, peer: ExternalAddress): Option<MessageTicket>{
123123

124-
// Cannot replace WH peers because of complexities with the accountant
124+
// Cannot replace WH peers because of complexities with the accountant, according to EVM implementation.
125125
assert!(!state.peers.contains(chain));
126+
state.peers.add(chain, peer);
126127

127128
broadcast_peer(chain, peer, state)
128129
}

sui/packages/wormhole_transceiver/sources/wormhole_transceiver_structs.move

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ module wormhole_transceiver::transceiver_structs {
4141
buf
4242
}
4343

44-
4544
public(package) fun new_transceiver_registration(transceiver_chain_id: u16, transceiver_address: ExternalAddress): WormholeTransceiverRegistration{
4645
WormholeTransceiverRegistration {
4746
transceiver_chain_id: transceiver_chain_id,

0 commit comments

Comments
 (0)