Skip to content

Commit

Permalink
Coinbase creation now handles the output data entity class
Browse files Browse the repository at this point in the history
  • Loading branch information
marekyggdrasil committed Mar 16, 2023
1 parent c286021 commit d7b9487
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ w = Wallet.initialize()
coinbase_path = 'm/0/1/0'
coinbase_amount = 60

kernel, output, path = w.createCoinbase(amount, path=path)
kernel, output = w.createCoinbase(coinbase_amount, path=coinbase_path)

# display the output
print('Kernel')
print(kernel.toJSON())
print('Output')
print(output.toJSON())
print(output.output.toJSON())
```

it will output something like
Expand Down
8 changes: 6 additions & 2 deletions mimblewimble/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ def createCoinbase(self, amount, path='m/0/1/0'):
EOutputFeatures.COINBASE_OUTPUT,
commitment,
rangeproof)
serializer = Serializer()

# build the output data entity
output_data_entity = OutputDataEntity(
path, blinding_factor, transaction_output, amount,
EOutputStatus.NO_CONFIRMATIONS)

# build the coinbase signature
message = blake2b(
Expand All @@ -184,7 +188,7 @@ def createCoinbase(self, amount, path='m/0/1/0'):
del agg

# return the result
return transaction_kernel, transaction_output, path
return transaction_kernel, output_data_entity


def createBlindedOutput(
Expand Down

0 comments on commit d7b9487

Please sign in to comment.