user5085: I am using the following function from the Plutus pioneer program:
stakeReferenceLedgerToPlutus :: Ledger.StakeReference StandardCrypto -> Maybe Plutus.StakingCredential
stakeReferenceLedgerToPlutus (StakeRefPtr (Ptr (SlotNo x) y z)) = Just $ StakingPtr (fromIntegral x) (fromIntegral y) (fromIntegral z)

But the latest release of Plutus-apps seems to require a change, because fromIntegral y does not work anymore. See error below:
error:
    • No instance for (Integral Cardano.Ledger.BaseTypes.TxIx)
        arising from a use of ‘fromIntegral’
    • In the second argument of ‘StakingPtr’, namely ‘(fromIntegral y)’

The same is true for fromIntegral z but for Cardano.Ledger.BaseTypes.CertIx.
Any help is appreciated.

user5926: The problem is that on the LHS you have:
StakeRefPtr (Ptr (SlotNo x) y z)

but StakeRefPtr is defined (in cardano-ledger repo, file libs/cardano-ledger-core/src/Cardano/Ledger/Credential.hs) as:
   | StakeRefPtr !Ptr

and Ptr is defined as:
data Ptr = Ptr !SlotNo !TxIx !CertIx

and TxIx is defined as:
newtype TxIx = TxIx Word64

That means, to get your code closer to working you should try:
stakeReferenceLedgerToPlutus :: Ledger.StakeReference StandardCrypto -> Maybe Plutus.StakingCredential
stakeReferenceLedgerToPlutus (StakeRefPtr (Ptr (SlotNo x) (TxIx y) z)) = Just $ StakingPtr (fromIntegral x) (fromIntegral y) (fromIntegral z)

You probably also need to do the same for the z which is defined as a:
newtype CertIx = CertIx Word64


5085: <p>I am using the following function from the Plutus pioneer program:</p>
<pre><code>stakeReferenceLedgerToPlutus :: Ledger.StakeReference StandardCrypto -&gt; Maybe Plutus.StakingCredential
stakeReferenceLedgerToPlutus (StakeRefPtr (Ptr (SlotNo x) y z)) = Just $ StakingPtr (fromIntegral x) (fromIntegral y) (fromIntegral z)
</code></pre>
<p>But the latest release of Plutus-apps seems to require a change, because <strong><code>fromIntegral y</code></strong> does not work anymore. See error below:</p>
<pre><code>error:
    • No instance for (Integral Cardano.Ledger.BaseTypes.TxIx)
        arising from a use of ‘fromIntegral’
    • In the second argument of ‘StakingPtr’, namely ‘(fromIntegral y)’
</code></pre>
<p>The same is true for <strong><code>fromIntegral z</code></strong> but for <code>Cardano.Ledger.BaseTypes.CertIx</code>.</p>
<p>Any help is appreciated.</p>
 5926: <p>The problem is that on the LHS you have:</p>
<pre><code>StakeRefPtr (Ptr (SlotNo x) y z)
</code></pre>
<p>but <code>StakeRefPtr</code> is defined (in <code>cardano-ledger</code> repo, file <code>libs/cardano-ledger-core/src/Cardano/Ledger/Credential.hs</code>) as:</p>
<pre><code>   | StakeRefPtr !Ptr
</code></pre>
<p>and <code>Ptr</code> is defined as:</p>
<pre><code>data Ptr = Ptr !SlotNo !TxIx !CertIx
</code></pre>
<p>and <code>TxIx</code> is defined as:</p>
<pre><code>newtype TxIx = TxIx Word64
</code></pre>
<p>That means, to get your code closer to working you should try:</p>
<pre><code>stakeReferenceLedgerToPlutus :: Ledger.StakeReference StandardCrypto -&gt; Maybe Plutus.StakingCredential
stakeReferenceLedgerToPlutus (StakeRefPtr (Ptr (SlotNo x) (TxIx y) z)) = Just $ StakingPtr (fromIntegral x) (fromIntegral y) (fromIntegral z)
</code></pre>
<p>You probably also need to do the same for the <code>z</code> which is defined as a:</p>
<pre><code>newtype CertIx = CertIx Word64
</code></pre>
