Replay protection for terra governance VAAs
Change-Id: Ib197e1d842093c578c2a6858c3b0a3ef3d18665d
This commit is contained in:
parent
895e40578c
commit
7f67ba1194
|
@ -255,16 +255,16 @@ fn submit_vaa<S: Storage, A: Api, Q: Querier>(
|
|||
let vaa = parse_vaa(deps, env.block.time, data)?;
|
||||
let data = vaa.payload;
|
||||
|
||||
// check if vaa is from governance
|
||||
if state.gov_chain == vaa.emitter_chain && state.gov_address == vaa.emitter_address {
|
||||
return handle_governance_payload(deps, env, &data);
|
||||
}
|
||||
|
||||
if vaa_archive_check(&deps.storage, vaa.hash.as_slice()) {
|
||||
return ContractError::VaaAlreadyExecuted.std_err();
|
||||
}
|
||||
vaa_archive_add(&mut deps.storage, vaa.hash.as_slice())?;
|
||||
|
||||
// check if vaa is from governance
|
||||
if state.gov_chain == vaa.emitter_chain && state.gov_address == vaa.emitter_address {
|
||||
return handle_governance_payload(deps, env, &data);
|
||||
}
|
||||
|
||||
let message = TokenBridgeMessage::deserialize(&data)?;
|
||||
|
||||
let result = match message.action {
|
||||
|
|
Loading…
Reference in New Issue