0xMiden / 0xMiden/tutorials

docs/fpi-bug: Miden Bank tutorial's "get_balance" and "deposit" method names collide with core library on v0.15.3

Abierto Apto para principiantes
#237 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
18
Forks
34
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### Documentation Issue / Namespace Collision
While building the official **Miden Bank** tutorial using the latest `mainnet` toolchain (`v0.15.3` and `miden-base v0.13.1`), I encountered a namespace collision and linker errors when compiling the `deposit-note` (or other cross-component FPI notes).

The original tutorial uses:
1. `deposit` method on the Bank account.
2. `get_balance` method on the Bank account.

### The Conflict
On v0.15.3, the `#[account(bank_account::BankAccount)]` macro expands into FPI bindings. However:
1. The `deposit` function name collides with the built-in standard library's `BasicWallet` `deposit` method.
2. The `get_balance` function name collides with the built-in `ActiveAccount`'s `get_balance` method, throwing the following error during `wasm-component-ld` linking:
`error: dependency function get-balance collides with the built-in ActiveAccount method get_balance; the generated wrapper method would shadow it. Rename the dependency function`

### The Solution
To successfully compile the Miden Bank tutorial on the new mainnet toolchain:
- Rename the `deposit` method to **`bank_deposit`** (or another unique name) in both the contract and the notes.
- Rename the `get_balance` method to **`check_balance`** in both the contract and the notes.

I suggest updating the official tutorial repository and documentation to reflect these v0.15.3 namespace rules.

### Reproduction Repo
I have compiled, tested, and resolved this in my local workspace here:
🔗 https://github.com/anaraydinli55/miden-testnet-project

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

The issue is about a namespace collision in the Miden Bank tutorial. The user has already identified the problematic method names (`deposit` and `get_balance`) and suggested new names (`bank_deposit` and `check_balance`). To resolve this, locate the tutorial files (likely in the repository's docs or examples directory) that define the Bank account contract and the associated notes. Update the method names in the contract source and any note definitions, then verify the changes compile without the linker error. The user's reproduction repo (https://github.com/anaraydinli55/miden-testnet-project) can be referenced for the exact changes needed.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
rust
Área
documentation
Tipo de issue
Documentación
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Tranquilo
Claridad
Bien especificado
Aptitud para principiantes
75/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.