Skip to content

Commit a43818d

Browse files
authored
fix: Specify sender address on reveal simulations (#2074)
abstract chain was not able to simulate these calls since the default from address was not a valid account
1 parent 6999fb9 commit a43818d

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

apps/fortuna/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/fortuna/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fortuna"
3-
version = "6.5.3"
3+
version = "6.5.4"
44
edition = "2021"
55

66
[dependencies]

apps/fortuna/src/chain/ethereum.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ impl<T: JsonRpcClient + 'static> EntropyReader for PythRandom<Provider<T>> {
379379

380380
async fn estimate_reveal_with_callback_gas(
381381
&self,
382+
sender: Address,
382383
provider: Address,
383384
sequence_number: u64,
384385
user_random_number: [u8; 32],
@@ -391,6 +392,7 @@ impl<T: JsonRpcClient + 'static> EntropyReader for PythRandom<Provider<T>> {
391392
user_random_number,
392393
provider_revelation,
393394
)
395+
.from(sender)
394396
.estimate_gas()
395397
.await;
396398

apps/fortuna/src/chain/reader.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub trait EntropyReader: Send + Sync {
6060
/// Estimate the gas required to reveal a random number with a callback.
6161
async fn estimate_reveal_with_callback_gas(
6262
&self,
63+
sender: Address,
6364
provider: Address,
6465
sequence_number: u64,
6566
user_random_number: [u8; 32],
@@ -184,6 +185,7 @@ pub mod mock {
184185

185186
async fn estimate_reveal_with_callback_gas(
186187
&self,
188+
sender: Address,
187189
provider: Address,
188190
sequence_number: u64,
189191
user_random_number: [u8; 32],

apps/fortuna/src/keeper.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ pub async fn process_event(
444444
let gas_estimate_res = chain_config
445445
.contract
446446
.estimate_reveal_with_callback_gas(
447+
contract.wallet().address(),
447448
event.provider_address,
448449
event.sequence_number,
449450
event.user_random_number,

0 commit comments

Comments
 (0)