8000 Fix/sybil account arg name by lachlanglen · Pull Request #52 · PotLock/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix/sybil account arg name #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified contracts/sybil/out/main.wasm
Binary file not shown.
11 changes: 10 additions & 1 deletion contracts/sybil/src/stamps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,16 @@ impl Contract {
// verify against provider, using custom gas if specified
let (contract_id, method_name) = provider_id.decompose();
let gas = Gas(provider.gas.unwrap_or(XCC_GAS_DEFAULT));
let args = json!({ "account_id": user_id }).to_string().into_bytes();

// Create a HashMap and insert the dynamic account_id_arg_name and value
let mut args_map = std::collections::HashMap::new();
args_map.insert(provider.account_id_arg_name.clone(), user_id.to_string());

// Serialize the HashMap to JSON string and then to bytes
let args = near_sdk::serde_json::to_string(&args_map)
.expect("Failed to serialize args")
.into_bytes();

Promise::new(AccountId::new_unchecked(contract_id.clone()))
.function_call(method_name.clone(), args, NO_DEPOSIT, gas)
.then(
Expand Down
3877
0