Skip to content

Commit

Permalink
Merge branch 'master' into hal3e/provider-on-chain-api
Browse files Browse the repository at this point in the history
  • Loading branch information
hal3e committed Oct 24, 2022
2 parents d0b57d3 + 6f71a8e commit e8e4e4b
Show file tree
Hide file tree
Showing 8 changed files with 1,228 additions and 1,215 deletions.
4 changes: 4 additions & 0 deletions docs/src/types/bits256.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ Here's an example:
```rust,ignore
{{#include ../../../packages/fuels/tests/bindings.rs:256_arg}}
```

If you have a hexadecimal value as a string and wish to convert it to `Bits256`, you may do so with `from_hex_str`:

{{#include ../../../packages/fuels-core/src/types/bits_256.rs:from_hex_str}}
4 changes: 4 additions & 0 deletions packages/fuels-core/src/code_gen/abigen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ impl Abigen {
Ok(Self { contract_id: self.contract_id.clone(), wallet: wallet, logs_lookup: self.logs_lookup.clone() })
}

pub async fn get_balances(&self) -> Result<HashMap<String, u64>, SDKError> {
self.wallet.get_provider()?.get_contract_balances(&self.contract_id).await.map_err(Into::into)
}

pub fn logs_with_type<D: Tokenizable + Parameterize>(&self, receipts: &[Receipt]) -> Result<Vec<D>, SDKError> {
extract_and_parse_logs(&self.logs_lookup, receipts)
}
Expand Down
1,087 changes: 614 additions & 473 deletions packages/fuels-core/src/code_gen/custom_types.rs

Large diffs are not rendered by default.

Loading

0 comments on commit e8e4e4b

Please sign in to comment.