Skip to content

Commit e88dde6

Browse files
authored
Merge pull request #52 from PotLock/fix/sybil-account-arg-name
Fix/sybil account arg name
2 parents 02197dd + f7a1688 commit e88dde6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

contracts/sybil/out/main.wasm

60 Bytes
Binary file not shown.

contracts/sybil/src/stamps.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,16 @@ impl Contract {
6767
// verify against provider, using custom gas if specified
6868
let (contract_id, method_name) = provider_id.decompose();
6969
let gas = Gas(provider.gas.unwrap_or(XCC_GAS_DEFAULT));
70-
let args = json!({ "account_id": user_id }).to_string().into_bytes();
70+
71+
// Create a HashMap and insert the dynamic account_id_arg_name and value
72+
let mut args_map = std::collections::HashMap::new();
73+
args_map.insert(provider.account_id_arg_name.clone(), user_id.to_string());
74+
75+
// Serialize the HashMap to JSON string and then to bytes
76+
let args = near_sdk::serde_json::to_string(&args_map)
77+
.expect("Failed to serialize args")
78+
.into_bytes();
79+
7180
Promise::new(AccountId::new_unchecked(contract_id.clone()))
7281
.function_call(method_name.clone(), args, NO_DEPOSIT, gas)
7382
.then(

0 commit comments

Comments
 (0)