Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-possibility-to-incentivise-relayer-on-consumer-chain #269

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resolver = "2"

[workspace.dependencies]
# nois = { git = "https://github.com/noislabs/nois", branch = "add-published-time" }
nois = "0.7.0"
nois = 0.8.0

[profile.release.package.nois-protocol]
codegen-units = 1
Expand Down
4 changes: 3 additions & 1 deletion contracts/nois-demo/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ mod tests {
use super::*;
use cosmwasm_std::{
testing::{mock_dependencies, mock_env, mock_info, MockApi, MockQuerier, MockStorage},
Empty, HexBinary, OwnedDeps, Timestamp,
Addr, Empty, HexBinary, OwnedDeps, Timestamp,
};

const CREATOR: &str = "creator";
Expand Down Expand Up @@ -185,6 +185,7 @@ mod tests {
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
)
.unwrap(),
relayer: Addr::unchecked("relayer"),
},
};
let info = mock_info(PROXY_ADDRESS, &[]);
Expand All @@ -203,6 +204,7 @@ mod tests {
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
)
.unwrap(),
relayer: Addr::unchecked("relayer"),
},
};
let info = mock_info("guest", &[]);
Expand Down
9 changes: 8 additions & 1 deletion contracts/nois-monitoring/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ pub fn execute_receive(
job_id,
published,
randomness,
relayer: _,
} = callback;

let randomness: [u8; 32] = randomness
Expand Down Expand Up @@ -185,7 +186,7 @@ mod tests {
use cosmwasm_std::testing::{
mock_dependencies, mock_env, mock_info, MockApi, MockQuerier, MockStorage,
};
use cosmwasm_std::{coins, Empty, HexBinary, OwnedDeps, Timestamp};
use cosmwasm_std::{coins, Addr, Empty, HexBinary, OwnedDeps, Timestamp};

const CREATOR: &str = "creator";
const PROXY_ADDRESS: &str = "the proxy of choice";
Expand Down Expand Up @@ -255,6 +256,7 @@ mod tests {
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
)
.unwrap(),
relayer: Addr::unchecked("relayer"),
},
};
let info = mock_info(PROXY_ADDRESS, &[]);
Expand All @@ -268,6 +270,7 @@ mod tests {
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
)
.unwrap(),
relayer: Addr::unchecked("relayer"),
},
};
let info = mock_info(PROXY_ADDRESS, &[]);
Expand All @@ -287,6 +290,7 @@ mod tests {
job_id: "round_1".to_string(),
published: Timestamp::from_seconds(1682086395),
randomness: HexBinary::from_hex("ffffffff").unwrap(),
relayer: Addr::unchecked("relayer"),
},
};
let info = mock_info(PROXY_ADDRESS, &[]);
Expand All @@ -312,6 +316,7 @@ mod tests {
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
)
.unwrap(),
relayer: Addr::unchecked("relayer"),
},
};
let info = mock_info(PROXY_ADDRESS, &[]);
Expand Down Expand Up @@ -339,6 +344,7 @@ mod tests {
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
)
.unwrap(),
relayer: Addr::unchecked("relayer"),
},
};
let info = mock_info("guest", &[]);
Expand All @@ -363,6 +369,7 @@ mod tests {
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
)
.unwrap(),
relayer: Addr::unchecked("relayer"),
},
};
let info = mock_info(PROXY_ADDRESS, &[]);
Expand Down
5 changes: 4 additions & 1 deletion contracts/nois-proxy/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ pub fn ibc_channel_close(
pub fn ibc_packet_receive(
deps: DepsMut,
env: Env,
info: MessageInfo,
msg: IbcPacketReceiveMsg,
) -> Result<IbcReceiveResponse, Never> {
// put this in a closure so we can convert all error responses into acknowledgements
Expand All @@ -775,7 +776,7 @@ pub fn ibc_packet_receive(
published,
randomness,
origin,
} => receive_deliver_beacon(deps, published, randomness, origin),
} => receive_deliver_beacon(deps, info, published, randomness, origin),
OutPacket::Welcome { payment } => receive_welcome(deps, env, payment),
OutPacket::PushBeaconPrice {
timestamp,
Expand All @@ -797,6 +798,7 @@ pub fn ibc_packet_receive(

fn receive_deliver_beacon(
deps: DepsMut,
info: MessageInfo,
published: Timestamp,
randomness: HexBinary,
origin: Binary,
Expand All @@ -821,6 +823,7 @@ fn receive_deliver_beacon(
job_id: job_id.clone(),
published,
randomness,
relayer: info.sender,
},
})?,
funds: vec![],
Expand Down