Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contract GerenciadorBoletos {
- struct Boleto {
- uint codigoBarra;
- uint codigoBarraDigitavel;
- uint cpfOuCnpjBeneficiario;
- uint cpfOuCnpjPagador;
- uint valorOriginal;
- uint dataVencimento;
- }
- mapping(uint => Boleto) registroBoletos;
- function inserirBoleto(
- uint codigoBarra,
- uint codigoBarraDigitavel,
- uint cpfOuCnpjBeneficiario,
- uint cpfOuCnpjPagador,
- uint valorOriginal,
- uint dataVencimento
- ) {
- Boleto memory b = Boleto(
- codigoBarra,
- codigoBarraDigitavel,
- cpfOuCnpjBeneficiario,
- cpfOuCnpjPagador,
- valorOriginal,
- dataVencimento
- );
- registroBoletos[b.codigoBarra] = b;
- }
- }
- describe('1. Inserção', function(){
- it('Deve ter inserido um boleto com os dados válidos com sucesso', function(done){
- var boletoParaInserir = gerarBoletoValido();
- console.log(boletoParaInserir);
- gerenciadorBoleto.inserirBoleto.sendTransaction(
- 9872387128, 987128382, 91289312, 81273818, 50, Date.now() + 3*24*3600,
- {
- from: web3.eth.accounts[0],
- gas: 3000000,
- },
- function(e, result) {
- expect(e).to.not.exist;
- expect(result).to.exist;
- result.should.be.above(0);
- }
- );
- });
- });
- Uncaught AssertionError: expected [Error: Error: VM Exception while
- executing transaction: invalid opcode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement