Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@m-kus
m-kus / pytezos_initial_storage.ipynb
Last active September 11, 2019 13:52
Encoding initial storage for a Michelson smart contract
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@m-kus
m-kus / pytezos_tx_params.ipynb
Created September 11, 2019 13:59
Encoding transaction parameters with PyTezos
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from os.path import dirname, join
from unittest import TestCase
from decimal import Decimal
from pytezos import ContractInterface, pytezos, format_timestamp, MichelsonRuntimeError
class MyContractTest(TestCase):
@classmethod
def setUpClass(cls):
parameter string;
storage string;
code { DUP;
DIP { CAR ; NIL string ; SWAP ; CONS } ;
CDR ; CONS ;
CONCAT ;
NIL operation; PAIR }
def test_concat(self):
res = self.my.call('bar').result(storage='foo')
self.assertEqual('foobar', res.storage)
cls.my = ContractInterface.create_from(join(dirname(__file__), 'my_contract.tz'),
shell='sandboxnet')
cls.my = ContractInterface.create_from(join(project_dir, 'src/my_contract.tz'),
factory=NonFungibleTokenImpl)