mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 15:41:02 +00:00
add constants api to codegen (#402)
* add constants api to codegen Signed-off-by: Gregory Hill <gregorydhill@outlook.com> * handle constant decoding error Signed-off-by: Gregory Hill <gregorydhill@outlook.com> * fix clippy and remove extra constants allocation Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
This commit is contained in:
@@ -261,4 +261,12 @@ async fn constant_existential_deposit() {
|
||||
let constant_metadata = balances_metadata.constant("ExistentialDeposit").unwrap();
|
||||
let existential_deposit = u128::decode(&mut &constant_metadata.value[..]).unwrap();
|
||||
assert_eq!(existential_deposit, 100_000_000_000_000);
|
||||
assert_eq!(
|
||||
existential_deposit,
|
||||
cxt.api
|
||||
.constants()
|
||||
.balances()
|
||||
.existential_deposit()
|
||||
.unwrap()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user