Skip to content

Commit e2be27e

Browse files
fix(barz): Try to replace u32 with i32
1 parent a5e85d7 commit e2be27e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rust/tw_evm/src/ffi/barz.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ pub unsafe extern "C" fn tw_barz_get_init_code_bridge(
102102
factory: Nonnull<TWString>,
103103
public_key: NonnullMut<TWPublicKey>,
104104
verification_facet: Nonnull<TWString>,
105-
salt: u32,
105+
salt: i32,
106106
) -> NullableMut<TWData> {
107+
let salt = try_or_else!(salt.try_into(), std::ptr::null_mut);
107108
tw_barz_get_init_code(factory, public_key, verification_facet, salt)
108109
}
109110

@@ -199,8 +200,9 @@ pub unsafe extern "C" fn tw_barz_get_prefixed_msg_hash(
199200
pub unsafe extern "C" fn tw_barz_get_prefixed_msg_hash_bridge(
200201
msg_hash: Nonnull<TWData>,
201202
barz_address: Nonnull<TWString>,
202-
chain_id: u32,
203+
chain_id: i32,
203204
) -> NullableMut<TWData> {
205+
let chain_id = try_or_else!(chain_id.try_into(), std::ptr::null_mut);
204206
tw_barz_get_prefixed_msg_hash(msg_hash, barz_address, chain_id)
205207
}
206208

0 commit comments

Comments
 (0)