diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b44f1fd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,16 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.8.0] + +### Added + +- randomness simulator (a predictable random seed based on block hash) +- The callback now contains a field with the relayer address. This would allow Dapps to incentivise the relayer diff --git a/Cargo.lock b/Cargo.lock index d709c48..3512416 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -395,7 +395,7 @@ dependencies = [ [[package]] name = "nois" -version = "0.7.0" +version = "0.8.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", diff --git a/Cargo.toml b/Cargo.toml index 297c71c..dbd55ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "nois" description = "The Nois standard library" repository = "https://github.com/noislabs/nois" -version = "0.7.0" +version = "0.8.0" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/src/proxy.rs b/src/proxy.rs index 9e22cbd..723aa1c 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -1,5 +1,5 @@ use cosmwasm_schema::cw_serde; -use cosmwasm_std::{HexBinary, Timestamp}; +use cosmwasm_std::{Addr, HexBinary, Timestamp}; /// Max length that the job ID is allowed to have (in bytes) /// @@ -47,6 +47,9 @@ pub struct NoisCallback { pub published: Timestamp, /// The randomness. This is guaranteed to be 32 bytes long. pub randomness: HexBinary, + /// The relayer that brings the packet from Nois to the consumer chain. + /// Might be useful if the Dapp wants to incentivise the relayer operator + pub relayer: Addr, } /// This is just a helper to properly serialize the above callback. @@ -74,12 +77,13 @@ mod tests { "aabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccdd", ) .unwrap(), + relayer: Addr::unchecked("relayer"), }, }; let ser = to_vec(&msg).unwrap(); assert_eq!( ser, - br#"{"nois_receive":{"callback":{"job_id":"first","published":"1682086395000000000","randomness":"aabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccdd"}}}"# + br#"{"nois_receive":{"callback":{"job_id":"first","published":"1682086395000000000","randomness":"aabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccdd","relayer":"relayer"}}}"# ); } }